From cppreference.com
This header was originally in the C standard library as
.
This header is part of the
library.
Macro constants
number of processor clock ticks per second
(macro constant)
implementation-defined null pointer constant
(macro constant)
Types
process running time
(typedef)
unsigned integer type returned by the
operator
(typedef)
time since epoch type
(typedef)
calendar time type
(class)
(C++17)
time in seconds and nanoseconds
(struct)
Functions
Time manipulation
returns raw processor clock time since the program is started
(function)
returns the current time of the system as time since epoch
(function)
computes the difference between times
(function)
(C++17)
returns the calendar time in seconds and nanoseconds based on a given time base
(function)
(C++26)
returns the resolution of calendar time based on a given time base
(function)
Format conversions
(deprecated in C++26)
converts a
object to a textual representation
(function)
(deprecated in C++26)
converts a
object to a textual representation
(function)
converts a
object to custom textual representation
(function)
(C++26)
converts time since epoch to calendar time expressed as Universal Coordinated Time
(function)
(C++26)
converts time since epoch to calendar time expressed as local time
(function)
converts calendar time to time since epoch
(function)
(C++26)
converts calendar time to time since epoch, ignoring the Daylight Saving Time flag
(function)
Synopsis
#define __STDC_VERSION_TIME_H__ 202311L#define NULL /* implementation-defined */#define CLOCKS_PER_SEC /* see description */#define TIME_UTC /* see description */#define TIME_MONOTONIC /* see description */// optional#define TIME_ACTIVE /* see description */// optional#define TIME_THREAD_ACTIVE /* see description */// optionalnamespacestd{usingsize_t=/* implementation-defined */;usingclock_t=/* see description */;usingtime_t=/* see description */;structtimespec;structtm;clock_tclock();doubledifftime(time_ttime1,time_ttime0);time_tmktime(tm*timeptr);time_ttimegm(tm*timeptr);time_ttime(time_t*timer);inttimespec_get(timespec*ts,intbase);inttimespec_getres(timespec*ts,intbase);// char* asctime(const tm* timeptr);// char* ctime(const time_t* timer);tm*gmtime(consttime_t*timer);tm*gmtime_r(consttime_t*timer,tm*buf);tm*localtime(consttime_t*timer);tm*localtime_r(consttime_t*timer,tm*buf);size_tstrftime(char*s,size_tmaxsize,constchar*format,consttm*timeptr);}Class
structtimespec{std::time_ttv_sec;longtv_nsec;};Class
structtm{inttm_sec;inttm_min;inttm_hour;inttm_mday;inttm_mon;inttm_year;inttm_wday;inttm_yday;inttm_isdst;};