命名空间
变体
操作

std::chrono::gps_clock::to_utc

来自 中国C++参考手册
< cpp‎ | chrono‎ | gps 时钟
 
 
 
 
template< class Duration >

static std::chrono::utc_time<std::common_type_t<Duration, std::chrono::seconds>>

    to_utc( const std::chrono::gps_time<Duration>& t ) noexcept;
(C++20 起)

gps_time t 转换为表示同一时间点的 utc_time

[编辑] 返回值

std::chrono::utc_time,表示与 t 相同的时间点,计算方式如同从 t.time_since_epoch() 构造返回类型的值并加上 315964809s (315964809 是两个时钟纪元之间的秒数:gps_clock 为 1980-01-06 00:00:00 UTC,utc_clock 为 1970-01-01 00:00:00 UTC)。

[编辑] 示例

[编辑] 参见

[静态]
utc_time 转换为 gps_time
(公共静态成员函数) [编辑]
将一个时钟的时间点转换为另一个时钟的时间点
(函数模板) [编辑]