diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-11-12 17:25:12 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-11-12 17:25:12 +0000 |
commit | 43beb6c40a44f94208e9ad1355758e58733bc1c2 (patch) | |
tree | a19c050f8c2df690142e7c99996ffbca08bea3a2 /src/http/ngx_http_parse_time.c | |
parent | d0d57b769ea960f7b4a8a95639580c91cfb5d4c5 (diff) | |
download | nginx-43beb6c40a44f94208e9ad1355758e58733bc1c2.tar.gz nginx-43beb6c40a44f94208e9ad1355758e58733bc1c2.zip |
nginx-0.0.1-2003-11-12-20:25:12 import
Diffstat (limited to 'src/http/ngx_http_parse_time.c')
-rw-r--r-- | src/http/ngx_http_parse_time.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/http/ngx_http_parse_time.c b/src/http/ngx_http_parse_time.c index 26deb2841..6b98bad43 100644 --- a/src/http/ngx_http_parse_time.c +++ b/src/http/ngx_http_parse_time.c @@ -232,19 +232,24 @@ time_t ngx_http_parse_time(char *value, size_t len) return NGX_ERROR; } - /* shift new year to March 1, needed for Gauss's formula */ + /* + * shift new year to March 1 and start months from 1 (not 0), + * it's needed for Gauss's formula + */ if (--month <= 0) { month += 12; year -= 1; } - /* Gauss's formula for Grigorian days from 1 March 1 BC */ + /* Gauss's formula for Grigorian days from 1 March 1 BC */ return (365 * year + year / 4 - year / 100 + year / 400 - + 367 * month / 12 + day - 31 + + 367 * month / 12 - 31 + + day + /* - * 719527 days are between March 1, 1 BC and March 1, 1970, + * 719527 days were between March 1, 1 BC and March 1, 1970, * 31 and 28 days in January and February 1970 */ |