2002-08-07 00:39:45 +08:00
|
|
|
|
|
|
|
#include <ngx_config.h>
|
2003-11-11 05:09:22 +08:00
|
|
|
#include <ngx_core.h>
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
|
|
|
|
void ngx_localtime(ngx_tm_t *tm)
|
|
|
|
{
|
2003-11-12 02:13:43 +08:00
|
|
|
#if (HAVE_LOCALTIME_R)
|
|
|
|
|
2003-11-11 05:09:22 +08:00
|
|
|
localtime_r(&ngx_cached_time, tm);
|
|
|
|
|
2003-11-12 02:13:43 +08:00
|
|
|
#else
|
|
|
|
ngx_tm_t *t;
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-11-12 02:13:43 +08:00
|
|
|
t = localtime(&ngx_cached_time);
|
|
|
|
*tm = *t;
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-11-12 02:13:43 +08:00
|
|
|
#endif
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-11-12 02:13:43 +08:00
|
|
|
tm->ngx_tm_mon++;
|
|
|
|
tm->ngx_tm_year += 1900;
|
2002-08-07 00:39:45 +08:00
|
|
|
}
|