Rev 4874 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * gmtime.c |
||
3 | * Original Author: G. Haley |
||
4 | * |
||
5 | * Converts the calendar time pointed to by tim_p into a broken-down time |
||
6 | * expressed as Greenwich Mean Time (GMT). Returns a pointer to a structure |
||
7 | * containing the broken-down time, or a null pointer if GMT is not |
||
8 | * available. |
||
9 | */ |
||
10 | |||
11 | /* |
||
12 | FUNCTION |
||
13 | < |
||
14 | |||
15 | INDEX |
||
16 | gmtime |
||
17 | INDEX |
||
18 | gmtime_r |
||
19 | |||
20 | ANSI_SYNOPSIS |
||
21 | #include |
||
22 | struct tm *gmtime(const time_t *<[clock]>); |
||
23 | struct tm *gmtime_r(const time_t *<[clock]>, struct tm *<[res]>); |
||
24 | |||
25 | TRAD_SYNOPSIS |
||
26 | #include |
||
27 | struct tm *gmtime(<[clock]>) |
||
28 | const time_t *<[clock]>; |
||
29 | struct tm *gmtime_r(<[clock]>, <[res]>) |
||
30 | const time_t *<[clock]>; |
||
31 | struct tm *<[res]>; |
||
32 | |||
33 | DESCRIPTION |
||
34 | < |
||
35 | of elapsed seconds since 00:00:00 on January 1, 1970, Universal |
||
36 | Coordinated Time (UTC, also known in some countries as GMT, |
||
37 | Greenwich Mean time) and converts it to a < |
||
38 | representation. |
||
39 | |||
40 | < |
||
41 | storage; each call to < |
||
42 | information generated by previous calls to either function. |
||
43 | |||
44 | RETURNS |
||
45 | A pointer to the traditional time representation (< |
||
46 | |||
47 | PORTABILITY |
||
48 | ANSI C requires < |
||
49 | |||
50 | < |
||
51 | */ |
||
52 | |||
53 | #include |
||
54 | #include |
||
55 | |||
56 | #define _GMT_OFFSET 0 |
||
57 | |||
58 | #ifndef _REENT_ONLY |
||
59 | |||
60 | struct tm * |
||
61 | _DEFUN (gmtime, (tim_p), |
||
62 | _CONST time_t * tim_p) |
||
63 | { |
||
4921 | Serge | 64 | struct _reent *reent = _REENT; |
65 | |||
66 | _REENT_CHECK_TM(reent); |
||
67 | return gmtime_r (tim_p, (struct tm *)_REENT_TM(reent)); |
||
4349 | Serge | 68 | } |
69 | |||
70 | #endif |