CTIME(3) — UNIX Programmer’s Manual
NAME
ctime, localtime, gmtime, asctime, timezone − convert date and time to ASCII
SYNOPSIS
char ∗ctime(clock)
long ∗clock;
#include <time.h>
struct tm ∗localtime(clock)
long ∗clock;
struct tm ∗gmtime(clock)
long ∗clock;
char ∗asctime(tm)
struct tm ∗tm;
char ∗timezone(zone, dst)
DESCRIPTION
Ctime converts a time pointed to by clock such as returned by time(2) into ASCII and returns a pointer to a 26-character string in the following form. All the fields have constant width.
Sun Sep 16 01:03:52 1973\n\0
Localtime and gmtime return pointers to structures containing the broken-down time. Localtime corrects for the time zone and possible daylight savings time; gmtime converts directly to GMT, which is the time UNIX uses. Asctime converts a broken-down time to ASCII and returns a pointer to a 26-character string.
The structure declaration from the include file is:
/∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗