summaryrefslogtreecommitdiff
path: root/man/2
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2007-09-01 14:43:39 +0000
committerCharles.Forsyth <devnull@localhost>2007-09-01 14:43:39 +0000
commit4252603c74a95023984422e8cc3520cc3d9340ac (patch)
tree80b7d96db673b3f6d767e40ba1c92a346980fae6 /man/2
parent6fe7bebd2f2f6637660b1b20674622b1eeaf6180 (diff)
20070901-1541
Diffstat (limited to 'man/2')
-rw-r--r--man/2/INDEX1
-rw-r--r--man/2/daytime45
2 files changed, 33 insertions, 13 deletions
diff --git a/man/2/INDEX b/man/2/INDEX
index f61422c4..61a1e4d0 100644
--- a/man/2/INDEX
+++ b/man/2/INDEX
@@ -28,6 +28,7 @@ filet daytime
gmt daytime
local daytime
now daytime
+string2tm daytime
text daytime
time daytime
tm2epoch daytime
diff --git a/man/2/daytime b/man/2/daytime
index 9e284916..01b8a85d 100644
--- a/man/2/daytime
+++ b/man/2/daytime
@@ -1,6 +1,6 @@
.TH DAYTIME 2
.SH NAME
-daytime: text, filet, gmt, local, now, time, tm2epoch \- time conversions
+daytime: text, filet, gmt, local, now, string2tm, time, tm2epoch \- time conversions
.SH SYNOPSIS
.EX
include "daytime.m";
@@ -20,13 +20,14 @@ Tm: adt
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;
+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;
.EE
.SH DESCRIPTION
These routines perform time conversions relative to the
@@ -42,7 +43,7 @@ converts a time structure referenced by
.I tm
from local or GMT time to a string in the format:
.IP
-.BR "Sat Jan 1 13:00:00 GMT 2000" .
+.B "Sat Jan 1 13:00:00 GMT 2000"
.PP
.B Filet
converts the file access or modification time
@@ -70,12 +71,10 @@ converts seconds since the epoch, received in
to a time structure in local time.
.PP
.B Now
-returns the time in seconds since the epoch, which
-it obtains by reading
+returns the time in seconds since the epoch, obtained by reading
.B /dev/time
(see
-.IR cons (3))
-to get the time in microseconds since the epoch.
+.IR cons (3)).
.PP
.B Time
converts seconds since the epoch
@@ -86,6 +85,26 @@ to the local time as a string in the format
converts a time structure referenced by
.I tm
from local or GMT time to seconds since the epoch.
+.PP
+.B String2tm
+returns a reference to a
+.B Tm
+value corresponding to the date and time in textual form in string
+.IR s ,
+which must have one of the forms below:
+.IP
+.EX
+Sun, 06 Nov 1994 08:49:37 GMT \fR(RFC822, RFC1123)\fP
+Sunday, 06-Nov-94 08:49:37 GMT \fR(RFC850)\fP
+Sun Nov 6 08:49:37 GMT 1994 \fR(output of \fPtext\fR, above)\fP
+.EE
+.PP
+A missing time zone in any format is assumed to be
+.BR GMT .
+.B String2tm
+returns nil if
+.I s
+is not correctly formed.
.SH SOURCE
.B /appl/lib/daytime.b
.SH SEE ALSO