Learn C++ practically
and Get Certified.
Popular Tutorials
Start Learning C++Learn C++ Interactively
Try Programiz PROLearn C++ practically
and Get Certified.
Try Programiz PRO!
Learn C++ practically
and Get Certified.
C++ <ctime>
The C++ <ctime>
header file declares a set of functions, macros and types to work with date and time. For example, the time()
function is used to get the current time.
C++ asctime()
converts calendar time to character representation
C++ clock()
returns processor time consumed by program
C++ ctime()
converts time since epoch to char representation
C++ difftime()
computes difference between two times in seconds
C++ gmtime()
converts given time since epoch to UTC time
C++ localtime()
converts given time since epoch to local time
C++ strftime()
converts calendar time to multibyte character str
C++ time()
Returns current calendar time