include "daytime.m";
daytime := load Daytime Daytime->PATH;
Tm: adt
{
sec: int; # seconds (0 to 59)
min: int; # minutes (0 to 59)
hour: int; # hours (0 to 23)
mday: int; # day of the month (1 to 31)
mon: int; # month (0 to 11)
year: int; # year-1900; 2000AD is 100
wday: int; # day of week (0 to 6, Sunday is 0)
yday: int; # day of year (0 to 365)
zone: string; # time zone name
tzoff: int; # time zone offset (seconds from GMT)
};
text: fn(tm: ref Tm): string;
filet: fn(now, t: int): string;
gmt: fn(tim: int): ref Tm;
local: fn(tim: int): ref Tm;
now: fn(): int;
time: fn(): string;
tm2epoch: fn(tm: ref Tm): int;
string2tm: fn(date: string): ref Tm;
Text converts a time structure referenced by tm from local or GMT time to a string in the format:
Filet converts the file access or modification time t from seconds since the epoch to local time as a string in the format:
if the file is less than 6 months old or
if the file is older than 6 months, compared to the time now.
Gmt converts seconds since the epoch, received in tim, to a time structure in Greenwich Mean Time (GMT).
Local converts seconds since the epoch, received in tim, to a time structure in local time.
Now returns the time in seconds since the epoch, obtained by reading /dev/time (see cons(3)).
Time converts seconds since the epoch to the local time as a string in the format Fri May 19 17:01:36 BST 2000.
Tm2epoch converts a time structure referenced by tm from local or GMT time to seconds since the epoch.
String2tm returns a reference to a Tm value corresponding to the date and time in textual form in string s, which must have one of the forms below:
Sun, 06 Nov 1994 08:49:37 GMT (RFC822, RFC1123) Sunday, 06-Nov-94 08:49:37 GMT (RFC850) Sun Nov 6 08:49:37 GMT 1994 (output of text , above)
A missing time zone in any format is assumed to be GMT. String2tm returns nil if s is not correctly formed.
| DAYTIME(2) | Rev: Sat Sep 01 14:36:29 GMT 2007 |