0
|
1 .TH libtws 3 "08 November 1986"
|
|
2 .SH NAME
|
|
3 libtws \- alternate date and time routines including parsing
|
|
4 .SH SYNOPSIS
|
|
5 .nf
|
|
6 .fc ^ ~
|
|
7 .ta \w'char *dtimezone( offset, flags ); 'u
|
|
8 include "tws.h"
|
|
9 .PP
|
|
10 ^struct tws *dlocaltime( clock );~^/* local clock into tws */
|
|
11 long *clock;
|
|
12 .PP
|
|
13 ^struct tws *gmtime( clock );~^/* GMT clock into tws */
|
|
14 long *clock;
|
|
15 .PP
|
|
16 ^char *dtime( clock );~^/* clock into string */
|
|
17 long *clock;
|
|
18 .PP
|
|
19 ^long twclock( t );~^/* tws into clock */
|
|
20 struct tws *t;
|
|
21 .PP
|
|
22 ^long twjuliandate( t );~^/* tws into Julian day number */
|
|
23 struct tws *t;
|
|
24 .PP
|
|
25 ^struct tws *dparsetime( str );~^/* string into tws */
|
|
26 char *str;
|
|
27 .PP
|
|
28 ^char *dctime( t );~^/* tws into string */
|
|
29 struct tws *t;
|
|
30 .PP
|
|
31 ^char *dasctime( t, flags );~^/* tws into string */
|
|
32 struct tws *t;
|
|
33 int flags;
|
|
34 .PP
|
|
35 ^char *dtimezone( offset, flags );~^/* timezone into string */
|
|
36 int offset, flags;
|
|
37 .PP
|
|
38 ^char *dtwszone( t );~^/* tws's timezone into string */
|
|
39 struct tws *t;
|
|
40 .PP
|
|
41 ^char *dtimemow( );~^/* current time into string */
|
|
42 .PP
|
|
43 ^struct tws *dtwstime( );~^/* current time into tws */
|
|
44 .PP
|
|
45 ^void twscopy( tot, fromt );~^/* copy a tws */
|
|
46 struct tws *tot, *fromt;
|
|
47 .PP
|
|
48 ^int twsort( t1, t2 );~^/* compare two tws's */
|
|
49 struct tws *t1, *t2;
|
|
50 .PP
|
|
51 ^long twsubtract( t1, t2 );~^/* seconds between t2 and t1 */
|
|
52 struct tws *t1, *t2;
|
|
53 .fi
|
|
54 .SH DESCRIPTION
|
|
55 .I Libtws
|
|
56 is a fairly complete date/time library.
|
|
57 Unlike the standard Unix date/time routines,
|
|
58 .I libtws
|
|
59 will parse date/time strings into internal form.
|
|
60 The format for specifying date/time strings is pretty loose - basically
|
|
61 the same as the format for date/times in network mail.
|
|
62 .PP
|
|
63 Most of the routines do not use the Unix(R) "clock" time
|
|
64 format, and therefore are not limited to dates after 01 January 1970.
|
|
65 In particular, twsubtract() lets you subtract two dates without
|
|
66 converting them to "clock" form.
|
|
67 .SH "SEE\ ALSO"
|
|
68 .IR ctime(3),
|
|
69 .IR time(3)
|
|
70 .SH AUTHOR
|
|
71 Most of
|
|
72 .I libtws
|
|
73 came from version 6.5 of the MH message
|
|
74 handling system, courtesy of Marshall Rose.
|
|
75 Some improvements (?) were added by Jef Poskanzer.
|
|
76 .SH BUGS
|
|
77 The return values point to static data whose contents are overwritten
|
|
78 by the next call.
|
|
79 .PP
|
|
80 The basic Unix time format (clock) only goes back to 1970, limiting
|
|
81 applications somewhat.
|