Namespaces
Variants
Actions

std::chrono::file_clock::to_sys, std::chrono::file_clock::from_sys

From cppreference.com
< cpp‎ | chrono‎ | file clock
 
C++
 
Date and time library
Time point
(C++11)
(C++20)
Duration
(C++11)
Clocks
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time of day
(C++20)(C++20)
(C++20)(C++20)
(C++20)
Calendar
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
chrono I/O
(C++20)

 
std::chrono::file_clock
Member functions

file_clock::to_sysfile_clock::from_sys
(optional*)

Time point I/O
 
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.

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

Contents

[edit] 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.

[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

[edit] See also

[static] (optional)
converts between file_time and utc_time
(public static member function) [edit]
convert time points of one clock to another
(function template) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant