std::chrono::system_clock::from_time_t

From cppreference.com
< cpp‎ | chrono‎ | system clock
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

Elementary string conversions
(C++17)
(C++17)
 
Date and time utilities
(C++11)
(C++11)
Time of day
(C++20)



(C++20)(C++20)(C++20)(C++20)
Clocks
(C++20)
                                             
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Calendars
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time zones
(C++20)
(C++20)
(C++20)
(C++20)
C-style date and time
 
 
static std::chrono::system_clock::time_point from_time_t( std::time_t t ) noexcept;
(since C++11)

Converts t to a time point type, using the coarser precision of the two types.

If time_point has lower precision, it is implementation defined whether the value is rounded or truncated.

Parameters

t - std::time_t value to convert

Return value

A value of type std::chrono::system_clock::time_point representing t.

See also

[static]
converts a system clock time point to std::time_t
(public static member function)