Home > Electronics Tutorials > C Language Tutorial > time.h - ctime

C Language Programming Library Reference Guide

time.h - ctime

Declaration: char *ctime(const time_t *timer); Returns a string representing the localtime based on the argument timer. This is equivalent to: asctime(locatime(timer)); The returned string is in the following format: DDD MMM dd hh:mm:ss YYYY
DDD Day of the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
MMM Month of the year (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
dd Day of the month (1,...,31)
hh Hour (0,...,23)
mm Minute (0,...,59)
ss Second (0,...,59)
The string is terminated with a newline character and a null character. The string is always 26 characters long (including the terminating newline and null characters).

A pointer to the string is returned.

Note: To report broken links or to submit your projects, tutorials please email to Webmaster