Difference between revisions of "cpp/chrono/file clock/to from utc"
From cppreference.com
< cpp | chrono | file clock
m (fmt) |
m (fmt.) |
||
Line 2: | Line 2: | ||
{{cpp/chrono/file_clock/navbar}} | {{cpp/chrono/file_clock/navbar}} | ||
{{dcl begin}} | {{dcl begin}} | ||
− | {{dcl|num=1|since=c++20|notes={{mark optional}}| | + | {{dcl|num=1|since=c++20|notes={{mark tooltip|optional|provided only if to_sys and from_sys are not provided}}| |
template< class Duration > | template< class Duration > | ||
static std::chrono::utc_time</* see below */> | static std::chrono::utc_time</* see below */> | ||
to_utc( const std::chrono::file_time<Duration>& t ); | to_utc( const std::chrono::file_time<Duration>& t ); | ||
}} | }} | ||
− | {{dcl|num=2|since=c++20|notes={{mark optional}}| | + | {{dcl|num=2|since=c++20|notes={{mark tooltip|optional|provided only if to_sys and from_sys are not provided}}| |
template< class Duration > | template< class Duration > | ||
static std::chrono::file_time</* see below */> | static std::chrono::file_time</* see below */> | ||
Line 19: | Line 19: | ||
The duration of the return type is computed from {{tt|Duration}} in an unspecified manner. | The duration of the return type is computed from {{tt|Duration}} in an unspecified manner. | ||
− | These function templates are optional: an implementation may choose to instead provide {{ | + | These function templates are optional: an implementation may choose to instead provide {{rlpf|to from sys|to_sys}} and {{rlpf|to from sys|from_sys}}. |
===Return value=== | ===Return value=== | ||
Line 26: | Line 26: | ||
===Notes=== | ===Notes=== | ||
− | User code should usually use {{ | + | User code should usually use {{c/core|std::chrono::clock_cast}}, which provides a generic interface to convert time points between clocks, rather than call these functions directly. |
===Example=== | ===Example=== |
Latest revision as of 17:19, 1 November 2024
template< class Duration > static std::chrono::utc_time</* see below */> |
(1) | (since C++20) (optional*) |
template< class Duration > static std::chrono::file_time</* see below */> |
(2) | (since C++20) (optional*) |
1) Converts the
file_time
t to a utc_time
representing the same point in time.2) Converts the
utc_time
t to a file_time
representing the same point in time.The duration of the return type is computed from Duration
in an unspecified manner.
These function templates are optional: an implementation may choose to instead provide to_sys()
and from_sys()
.
Contents |
[edit] Return value
1) A
utc_time
representing the same point in time as the argument.2) A
file_time
representing the same point in time as the argument.[edit] Notes
User code should usually use std::chrono::clock_cast, which provides a generic interface to convert time points between clocks, rather than call these functions directly.
[edit] Example
This section is incomplete Reason: no example |
[edit] See also
[static] (optional) |
converts between file_time and sys_time (public static member function) |
(C++20) |
convert time points of one clock to another (function template) |