blob: 72137f95295d4cc5e79f3b8ddcd0a1c16d7786db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/*
* Copyright (C) Igor Sysoev
*/
#include <ngx_config.h>
#include <ngx_core.h>
void ngx_localtime(ngx_tm_t *tm)
{
#if (NGX_HAVE_LOCALTIME_R)
time_t now;
now = ngx_time();
localtime_r(&now, tm);
#else
time_t now;
ngx_tm_t *t;
now = ngx_time();
t = localtime(&now);
*tm = *t;
#endif
tm->ngx_tm_mon++;
tm->ngx_tm_year += 1900;
}
void ngx_libc_localtime(struct tm *tm)
{
#if (NGX_HAVE_LOCALTIME_R)
time_t now;
now = ngx_time();
localtime_r(&now, tm);
#else
time_t now;
struct tm *t;
now = ngx_time();
t = localtime(&now);
*tm = *t;
#endif
}
void ngx_libc_gmtime(struct tm *tm)
{
#if (NGX_HAVE_LOCALTIME_R)
time_t now;
now = ngx_time();
gmtime_r(&now, tm);
#else
time_t now;
struct tm *t;
now = ngx_time();
t = gmtime(&now);
*tm = *t;
#endif
}
|