aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_time.c
blob: 5ba95bc30df153ddef7245748fe3558d3c9eab45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <ngx_config.h>
#include <ngx_core.h>


void ngx_localtime(ngx_tm_t *tm)
{
#if (HAVE_LOCALTIME_R)

    localtime_r((time_t *) &ngx_cached_time, tm);

#else
    ngx_tm_t  *t;

    t = localtime((time_t *) &ngx_cached_time);
    *tm = *t;

#endif

    tm->ngx_tm_mon++;
    tm->ngx_tm_year += 1900;
}