comparison src/core/ngx_times.c @ 181:811bdd2af794

nginx-0.0.1-2003-11-12-20:25:12 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 12 Nov 2003 17:25:12 +0000
parents 2d143372a1ee
children 3c49eaf3f522
comparison
equal deleted inserted replaced
180:2d143372a1ee 181:811bdd2af794
33 33
34 /* STUB: need to move to ngx_init_time() */ 34 /* STUB: need to move to ngx_init_time() */
35 ngx_cached_http_time.data = cached_http_time; 35 ngx_cached_http_time.data = cached_http_time;
36 ngx_cached_http_log_time.data = cached_http_log_time; 36 ngx_cached_http_log_time.data = cached_http_log_time;
37 37
38 #if 0
39
40 days = sec / 86400;
41 days = days - 31 - 28 + 719527;
42
43 year = days * 400 / (365 * 400 + 100 - 4 + 1);
44 yday = days - (365 * year + year / 4 - year / 100 + year / 400);
45
46 month = (yday + 30) * 12 / 367;
47 mday = yday - (month * 367 / 12 - 31);
48
49 if (++month > 11) {
50 month -= 12;
51 year++;
52 }
53
54 #endif
55
38 tp = gmtime(&ngx_cached_time); 56 tp = gmtime(&ngx_cached_time);
39 57
40 ngx_cached_http_time.len = strftime(ngx_cached_http_time.data, 58 ngx_cached_http_time.len = strftime(ngx_cached_http_time.data,
41 sizeof("Mon, 28 Sep 1970 06:00:00 GMT"), 59 sizeof("Mon, 28 Sep 1970 06:00:00 GMT"),
42 "%a, %d %b %Y %H:%M:%S GMT", tp); 60 "%a, %d %b %Y %H:%M:%S GMT", tp);