std::chrono...ck::from_sys(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 std::chrono::file_clock::to_sys & std::chrono::file_clock::from_sys 🌸

okay bestie, welcome to the std::chrono...ck::from_sys(3) page from the C++ Standard Libary manual (yes, β€œLibary” is literally how it’s spelled there πŸ’…). This is the std::chrono::file_clock::to_sys / std::chrono::file_clock::from_sys zone, and it’s giving optional conversion-template realness. Let’s get into it.


πŸ’– NAME

  • std::chrono::file_clock::to_sys,std::chrono::file_clock::from_sys β€” std::chrono::file_clock::to_sys,std::chrono::file_clock::from_sys

✨ Synopsis ✨

template< class Duration >
static std::chrono::sys_time</*see below*/>
to_sys( const std::chrono::file_time<Duration>& t );

(1) (since C++20) (optional)

template< class Duration >
static std::chrono::file_time</*see below*/>
from_sys( const std::chrono::sys_time<Duration>& t );

(2) (since C++20) (optional)

  1. Converts the file_time t to a sys_time representing the same point in time.
  2. Converts the sys_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. no cap, that’s what it says 🫢

These function templates are optional: an implementation may choose to instead provide to_utc and from_utc.

πŸ’– Return value πŸ’–

  1. A sys_time representing the same point in time as the argument.
  2. A file_time representing the same point in time as the argument.

πŸ¦‹ 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. bestie, that’s the main-character move πŸ’…

πŸŽ€ Example πŸŽ€

This section is incomplete

Reason: no example

😭 they really said β€œno example” and left. iconic but unhelpful.

πŸ”₯ See also πŸ”₯

  • to_utc β€” converts between file_time and utc_time
  • from_utc β€” (public static member function)
  • [static] (optional) β€” yep, that’s the tag sitting right there in the block
  • clock_cast (C++20) β€” convert time points of one clock to another (function template)

🏷️ Category

  • Todo no example

🫢 source/version + date check, bestie: http://cppreference.com, 2024.06.10, and this page’s footer id is std::chrono...ck::from_sys(3). that’s the whole sign-off πŸ’–
πŸ“¦ where this page comes from