1: # include <time.h>
2:
3: static char SccsId[] = "@(#)arpadate.c 2.1 11/5/80";
4:
5: /*
6: ** ARPADATE -- Create date in ARPANET format
7: **
8: ** Parameters:
9: ** none
10: **
11: ** Returns:
12: ** pointer to an ARPANET date field
13: **
14: ** Side Effects:
15: ** none
16: **
17: ** WARNING:
18: ** date is stored in a local buffer -- subsequent
19: ** calls will overwrite.
20: */
21:
22: char *
23: arpadate()
24: {
25: register char *ud; /* the unix date */
26: long t;
27: extern struct tm *localtime();
28: register char *p;
29: static char b[40];
30: extern char *ctime();
31:
32: time(&t);
33: ud = ctime(&t);
34:
35: ud[3] = ud[7] = ud[10] = ud[19] = ud[24] = '\0';
36: p = &ud[8]; /* 16 */
37: if (*p == ' ')
38: p++;
39: strcpy(b, p);
40: strcat(b, " ");
41: strcat(b, &ud[4]); /* Sep */
42: strcat(b, " ");
43: strcat(b, &ud[20]); /* 1979 */
44: strcat(b, " ");
45: strcat(b, &ud[11]); /* 01:03:52 */
46: if (localtime(&t)->tm_isdst)
47: strcat(b, "-PDT");
48: else
49: strcat(b, "-PST");
50: return (b);
51: }
Defined functions
Defined variables
SccsId
defined in line
3;
never used