◐ Shell
clean mode source ↗

C Date and time utilities

From cppreference.com

Functions

Time manipulation

Defined in header <ctime>

computes the difference between times
(function) [edit]
returns the current time of the system as time since epoch
(function) [edit]
returns raw processor clock time since the program is started
(function) [edit]
returns the calendar time in seconds and nanoseconds based on a given time base
(function) [edit]
returns the resolution of calendar time based on a given time base
(function) [edit]
Format conversions

Defined in header <ctime>

(deprecated in C++26)

converts a std::tm object to a textual representation
(function) [edit]

(deprecated in C++26)

converts a std::time_t object to a textual representation
(function) [edit]
converts a std::tm object to custom textual representation
(function) [edit]

Defined in header <cwchar>

converts a std::tm object to custom wide string textual representation
(function) [edit]

Defined in header <ctime>

converts time since epoch to calendar time expressed as Universal Coordinated Time
(function) [edit]
converts time since epoch to calendar time expressed as local time
(function) [edit]
converts calendar time to time since epoch
(function) [edit]

(C++26)

converts calendar time to time since epoch, ignoring the Daylight Saving Time flag
(function) [edit]

Constants

Types

See also