std::chrono...ck::from_utc(3)
π
std::chrono::file_clock::to_utc / std::chrono::file_clock::from_utc π
okay so bestie, this page is from the C++ Standard Libary manual, and the main characters are std::chrono::file_clock::to_utc and std::chrono::file_clock::from_utc β iconic clock-conversion duo, no cap π°οΈβ¨
β¨ Synopsis β¨
two function templates, both since C++20, both optional β here's the exact shape:
template< class Duration >
(since
C++20)
static std::chrono::utc_time</* see below */> (1)
(optional)
to_utc( const std::chrono::file_time<Duration>& t );
template< class Duration >
(since
C++20)
static std::chrono::file_time</* see below */> (2)
(optional)
from_utc( const std::chrono::utc_time<Duration>& t );
- Converts the
file_timetto autc_timerepresenting the same point in time. - Converts the
utc_timetto afile_timerepresenting 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. like, they can lowkey swap them out on you, so don't act surprised π
π«Ά Return value π«Ά
- A
utc_timerepresenting the same point in time as the argument. - A
file_timerepresenting the same point in time as the argument.
same moment, different clock outfit β slay π«
πΈ Notes πΈ
bestie, real talk: 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. it's giving "use the main character API, not the side quest" energy π§
π¦ Example π¦
This section is incomplete.
Reason: no example.
not me showing up with an empty example section π it's literally just vibes and a todo π
π See also π
to_sysβ converts betweenfile_timeandsys_timefrom_sysβ(public static member function)[static](optional)clock_castβ convert time points of one clock to another(C++20)(function template)
π Category π
Todo no example
with all the love and zero cap, this page came from source/version http://cppreference.com, dated 2024.06.10, page std::chrono...ck::from_utc(3) πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms