9srv Manual Collection/plan9/ctime(2) | 9srv Manual Collection/plan9/ctime(2) |
---|
char* ctime(long clock)
Tm* localtime(long clock)
Tm* gmtime(long clock)
char* asctime(Tm *tm)
long tm2sec(Tm *tm)
/env/timezone
Wed Aug 5 01:07:47 EST 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. Asctime converts a broken-down time to ASCII and returns a pointer to a 30-byte string.
Tm2sec converts a broken-down time to seconds since the start of the epoch. It ignores wday, and assumes the local time zone if zone is not GMT.
When local time is first requested, the program consults the timezone environment variable to determine the time zone and converts accordingly. (This variable is set at system boot time by init(8).) The timezone variable contains the normal time zone name and its difference from GMT in seconds followed by an alternate (daylight) time zone name and its difference followed by a newline. The remainder is a list of pairs of times (seconds past the start of 1970, in the first time zone) when the alternate time zone applies. For example:
Greenwich Mean Time is represented by
9srv Manual Collection/plan9/ctime(2) | Rev: Sun Dec 02 23:42:17 GMT 2007 |