Mercurial > hg > nginx
comparison src/core/ngx_times.c @ 208:0b67be7d4489
nginx-0.0.1-2003-12-08-23:48:12 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 08 Dec 2003 20:48:12 +0000 |
parents | 6e0fef527732 |
children | 05592fd7a436 |
comparison
equal
deleted
inserted
replaced
207:6e0fef527732 | 208:0b67be7d4489 |
---|---|
114 wday = (4 + days) % 7; | 114 wday = (4 + days) % 7; |
115 | 115 |
116 t %= 86400; | 116 t %= 86400; |
117 hour = t / 3600; | 117 hour = t / 3600; |
118 t %= 3600; | 118 t %= 3600; |
119 min = t / 60; | 119 min = t / 60; |
120 sec = t % 60; | 120 sec = t % 60; |
121 | 121 |
122 /* the algorithm based on Gauss's formula */ | 122 /* the algorithm based on Gauss's formula */ |
123 | 123 |
124 days = days - (31 + 28) + 719527; | 124 days = days - (31 + 28) + 719527; |
125 | 125 |
126 year = days * 400 / (365 * 400 + 100 - 4 + 1); | 126 year = days * 400 / (365 * 400 + 100 - 4 + 1); |
127 yday = days - (365 * year + year / 4 - year / 100 + year / 400); | 127 yday = days - (365 * year + year / 4 - year / 100 + year / 400); |
128 | 128 |