/* * localtime.c */ /* FUNCTION <>---convert time to local representation INDEX localtime INDEX localtime_r SYNOPSIS #include struct tm *localtime(time_t *<[clock]>); struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>); DESCRIPTION <> converts the time at <[clock]> into local time, then converts its representation from the arithmetic representation to the traditional representation defined by <>. <> constructs the traditional time representation in static storage; each call to <> or <> will overwrite the information generated by previous calls to either function. <> is the inverse of <>. RETURNS A pointer to the traditional time representation (<>). PORTABILITY ANSI C requires <>. <> requires no supporting OS subroutines. */ #include #include #include #ifndef _REENT_ONLY struct tm * localtime (const time_t * tim_p) { struct _reent *reent = _REENT; _REENT_CHECK_TM(reent); return localtime_r (tim_p, (struct tm *)_REENT_TM(reent)); } #endif