3 * Original Author: G. Haley
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
13 <<gmtime>>---convert time to UTC traditional form
22 struct tm *gmtime(const time_t *<[clock]>);
23 struct tm *gmtime_r(const time_t *<[clock]>, struct tm *<[res]>);
26 <<gmtime>> takes the time at <[clock]> representing the number
27 of elapsed seconds since 00:00:00 on January 1, 1970, Universal
28 Coordinated Time (UTC, also known in some countries as GMT,
29 Greenwich Mean time) and converts it to a <<struct tm>>
32 <<gmtime>> constructs the traditional time representation in static
33 storage; each call to <<gmtime>> or <<localtime>> will overwrite the
34 information generated by previous calls to either function.
37 A pointer to the traditional time representation (<<struct tm>>).
40 ANSI C requires <<gmtime>>.
42 <<gmtime>> requires no supporting OS subroutines.
50 #ifdef _REENT_THREAD_LOCAL
51 _Thread_local
struct __tm _tls_localtime_buf
;
57 gmtime (const time_t * tim_p
)
59 struct _reent
*reent
= _REENT
;
61 _REENT_CHECK_TM(reent
);
62 return gmtime_r (tim_p
, (struct tm
*)_REENT_TM(reent
));