/* * localtime.c */ /* FUNCTION <>---convert time to local representation INDEX localtime INDEX localtime_r ANSI_SYNOPSIS #include struct tm *localtime(time_t *<[clock]>); struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>); TRAD_SYNOPSIS #include struct tm *localtime(<[clock]>) time_t *<[clock]>; struct tm *localtime(<[clock]>, <[res]>) 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 #ifndef _REENT_ONLY struct tm * _DEFUN (localtime, (tim_p), _CONST time_t * tim_p) { _REENT_CHECK_TM(_REENT); return localtime_r (tim_p, (struct tm *)_REENT_TM(_REENT)); } #endif