From 43beb6c40a44f94208e9ad1355758e58733bc1c2 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 12 Nov 2003 17:25:12 +0000 Subject: nginx-0.0.1-2003-11-12-20:25:12 import --- src/core/ngx_times.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/ngx_times.c') diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c index af801d746..fcc7152ab 100644 --- a/src/core/ngx_times.c +++ b/src/core/ngx_times.c @@ -35,6 +35,24 @@ void ngx_time_update() ngx_cached_http_time.data = cached_http_time; ngx_cached_http_log_time.data = cached_http_log_time; +#if 0 + + days = sec / 86400; + days = days - 31 - 28 + 719527; + + year = days * 400 / (365 * 400 + 100 - 4 + 1); + yday = days - (365 * year + year / 4 - year / 100 + year / 400); + + month = (yday + 30) * 12 / 367; + mday = yday - (month * 367 / 12 - 31); + + if (++month > 11) { + month -= 12; + year++; + } + +#endif + tp = gmtime(&ngx_cached_time); ngx_cached_http_time.len = strftime(ngx_cached_http_time.data, -- cgit