std::ctime

From Cppreference

< cpp | chrono | c
Jump to: navigation, search
Defined in header <ctime>

char *ctime( const time_t *time );

Converts given time since epoch to a calendar local time and then to a textual representation. The resulting string has the following format:

Www Mmm dd hh:mm:ss yyyy

The function does not support localization.

Contents

[edit] Parameters

time - pointer to a time_t object specifying the time to print

[edit] Return value

pointer to a static character string. The string is shared among ctime() and asctime() and is overwritten on each invocation.

[edit] Example

[edit] See also

asctime
converts a time_t object to a textual representation
(function)
strftime
converts a tm object to custom textual representation
(function)