2 Proprietary Rand Corporation
, 1981.
3 Further distribution of
this software
4 subject to the terms of the Rand
8 /** Version of date.c in s1 modified to be a subroutine
9 * it is called with a string and returns a pointer to ints.
10 * ie, ip = date(string);
11 * returns 0 if it fails.
12 * only error message is bad conversion if string is illegal.
13 * The only legal format is ########[ps]
14 * where the int field is fixed input and 'p' forces PM by adding 12 hours
15 * and 's' would force standard savings time
24 extern int timezone
, *localtime();
28 write(2, "bad conversion\n", 15);
32 /* convert to Greenwich time, on assumption of Standard time. */
33 dpadd(timbuf
, timezone
);
34 /* Now fix up to local daylight time. */
35 if ((cpx
= localtime(timbuf
))[8])
36 dpadd(timbuf
, -1*60*60);
46 extern int *localtime();
78 if (dysize(y
)==366 && t
>= 3)
121 c
= (*cp
++ - '0') * 10;
126 if ((d
= *cp
++ - '0') < 0 || d
> 9)