|
|
1.1 root 1: /* tm2ut.c - tm to time string */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/psap/RCS/tm2ut.c,v 7.0 89/11/23 22:13:54 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/psap/RCS/tm2ut.c,v 7.0 89/11/23 22:13:54 mrose Rel $
9: *
10: *
11: * $Log: tm2ut.c,v $
12: * Revision 7.0 89/11/23 22:13:54 mrose
13: * Release 6.0
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: /* LINTLIBRARY */
29:
30: #include <stdio.h>
31: #include "psap.h"
32: #ifdef OSX
33: #include <sys/time.h>
34: #endif
35:
36:
37: #define YEAR(y) ((y) >= 100 ? (y) : (y) + 1900)
38:
39: /* */
40:
41: void tm2ut (tm, ut)
42: register struct tm *tm;
43: register UTC ut;
44: {
45: bzero ((char *) ut, sizeof *ut);
46:
47: ut -> ut_year = YEAR (tm -> tm_year);
48: ut -> ut_mon = tm -> tm_mon + 1;
49: ut -> ut_mday = tm -> tm_mday;
50: ut -> ut_hour = tm -> tm_hour;
51: ut -> ut_min = tm -> tm_min;
52: ut -> ut_sec = tm -> tm_sec;
53: ut -> ut_zone = 0;
54:
55: ut -> ut_flags = UT_ZONE | UT_SEC;
56: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.