comparison src/http/ngx_http_parse_time.c @ 29:6a0b3d6e9c13

nginx-0.0.1-2002-12-17-18:48:27 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 17 Dec 2002 15:48:27 +0000
parents 53cb81681040
children 0e81ac0bb3e2
comparison
equal deleted inserted replaced
28:a117a7fdf042 29:6a0b3d6e9c13
205 /* shift new year to 1st March, needed for Gauss's formula */ 205 /* shift new year to 1st March, needed for Gauss's formula */
206 if (--month <= 0) { 206 if (--month <= 0) {
207 month += 12; 207 month += 12;
208 year -= 1; 208 year -= 1;
209 } 209 }
210 /* Gauss's formula for days from 1 March 1 BC */ 210 /* Gauss's formula for Grigorian days from 1 March 1 BC */
211 return (365 * year + year / 4 - year / 100 + year / 400 211 return (365 * year + year / 4 - year / 100 + year / 400
212 + 367 * month / 12 + day - 31 212 + 367 * month / 12 + day - 31
213 /* 719527 days are between 1 March 1 BC and 1 March 1970, 213 /* 719527 days are between 1 March 1 BC and 1 March 1970,
214 31 and 28 days in Jan and Feb 1970 */ 214 31 and 28 days in Jan and Feb 1970 */
215 - 719527 + 31 + 28) * 86400 + hour * 3600 + min * 60 + sec; 215 - 719527 + 31 + 28) * 86400 + hour * 3600 + min * 60 + sec;