aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_time.c')
-rw-r--r--src/os/unix/ngx_time.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c
index 12256e13a..bf3432ba7 100644
--- a/src/os/unix/ngx_time.c
+++ b/src/os/unix/ngx_time.c
@@ -1,11 +1,12 @@
#include <ngx_config.h>
-#include <ngx_time.h>
+#include <ngx_core.h>
+
void ngx_localtime(ngx_tm_t *tm)
{
- time_t clock = time(NULL);
- localtime_r(&clock, tm);
+ localtime_r(&ngx_cached_time, tm);
+
tm->ngx_tm_mon++;
tm->ngx_tm_year += 1900;
}