Converts given time since epoch to a calendar local time and then to a textual representation, as if by calling std::asctime(std::localtime(time)). The resulting string has the following format:
Www Mmm dd hh:mm:ss yyyy\n
Www
- the day of the week (one of Mon
, Tue
, Wed
, Thu
, Fri
, Sat
, Sun
).Mmm
- the month (one of Jan
, Feb
, Mar
, Apr
, May
, Jun
, Jul
, Aug
, Sep
, Oct
, Nov
, Dec
).dd
- the day of the month.hh
- hours.mm
- minutes.ss
- seconds.yyyy
- years.The function does not support localization.
[edit] Parameters time - pointer to a std::time_t object specifying the time to print [edit] Return valuePointer to a static null-terminated character string holding the textual representation of date and time. The string may be shared between std::asctime and std::ctime
, and may be overwritten on each invocation of any of those functions.
This function returns a pointer to static data and is not thread-safe. In addition, it modifies the static std::tm object which may be shared with std::gmtime and std::localtime. POSIX marks this function obsolete and recommends std::strftime instead.
The behavior may be undefined for the values of std::time_t that result in the string longer than 25 characters (e.g. year 10000).
[edit] ExamplePossible output:
Mon Oct 11 17:10:55 2021 Mon Oct 11 17:10:55 2021[edit] See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4