std::chrono::gps_clock:: to_utc
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
gps_clock::to_utc
|
||||
| Time point I/O | ||||
|
template
<
class
Duration
>
static
std::
chrono
::
utc_time
<
std::
common_type_t
<
Duration,
std::
chrono
::
seconds
>>
|
(C++20 起) | |
将
gps_time
t
转换为表示同一时间点的
utc_time
。
返回值
一个表示与
t
相同时间点的
std::chrono::utc_time
,其计算方式为:通过从
t.
time_since_epoch
(
)
构造返回类型的值,并加上
315964809s
(315964809 是两个时钟纪元之间的秒数差:
gps_clock
的纪元为 1980-01-06 00:00:00 UTC,而
utc_clock
的纪元为 1970-01-01 00:00:00 UTC)。
示例
|
本节内容不完整
原因:缺少示例 |
参见
|
[static]
|
将
utc_time
转换为
gps_time
(公开静态成员函数) |
|
(C++20)
|
将一个时钟的时间点转换为另一个时钟的时间点
(函数模板) |