Namespaces
Variants

std::chrono::gps_clock:: from_utc

From cppreference.net
template < class Duration >

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

from_utc ( const std:: chrono :: utc_time < Duration > & ) noexcept ;
(C++20 起)

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

返回值

一个 std::chrono::gps_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)。

示例

参见

[static]
gps_time 转换为 utc_time
(公开静态成员函数)
(C++20)
将一个时钟的时间点转换为另一个时钟的时间点
(函数模板)