<time.h> |
||
---|---|---|
char* ctime ( const time_t* timer ); | (1) | |
char* ctime_r( const time_t* timer, char* buf ); | (2) | (since C23) |
errno_t ctime_s( char buf, rsize_t bufsz, const time_t timer ); | (3) | (since C11) |
该函数执行了两步操作,相当于:
asctime(localtime(timer)) or asctime(localtime_r(timer, &(struct tm){0}))
返回的字符串格式:
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, N