Mercurial > hg > nginx-quic
annotate src/http/ngx_http_parse_time.c @ 2025:638bbe2464f3
delete useless lines
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 22 May 2008 14:28:25 +0000 |
parents | a3e84e78e785 |
children | f62751dab60d |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
5 |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
7 #include <ngx_config.h> |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
8 #include <ngx_core.h> |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
9 #include <ngx_types.h> |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
11 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
12 static int mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 |
1628 | 14 time_t |
15 ngx_http_parse_time(u_char *value, size_t len) | |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
16 { |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
181
diff
changeset
|
17 u_char *p, *end; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
181
diff
changeset
|
18 int day, month, year, hour, min, sec; |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
19 enum { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
20 no = 0, |
684 | 21 rfc822, /* Tue, 10 Nov 2002 23:50:13 */ |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
22 rfc850, /* Tuesday, 10-Dec-02 23:50:13 */ |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
23 isoc /* Tue Dec 10 23:50:13 2002 */ |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
24 } fmt; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
25 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
26 fmt = 0; |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
27 end = value + len; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
28 |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
29 #if (NGX_SUPPRESS_WARN) |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
30 day = 32; |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
31 year = 2038; |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
32 #endif |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
33 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
34 for (p = value; p < end; p++) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
35 if (*p == ',') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
36 break; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
37 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
38 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
39 if (*p == ' ') { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
40 fmt = isoc; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
41 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
42 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
43 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
45 for (p++; p < end; p++) |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
46 if (*p != ' ') { |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
47 break; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
48 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
49 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
50 if (end - p < 18) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
51 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
52 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
53 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
54 if (fmt != isoc) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
55 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
56 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
57 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
58 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
59 day = (*p - '0') * 10 + *(p + 1) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
60 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
61 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
62 if (*p == ' ') { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
63 if (end - p < 18) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
64 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
65 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
66 fmt = rfc822; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
67 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
68 } else if (*p == '-') { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
69 fmt = rfc850; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
70 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
71 } else { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
72 return NGX_ERROR; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
73 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
74 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
75 p++; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
76 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
77 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
78 switch (*p) { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
79 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
80 case 'J': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
81 month = *(p + 1) == 'a' ? 0 : *(p + 2) == 'n' ? 5 : 6; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
82 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
83 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
84 case 'F': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
85 month = 1; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
86 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
87 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
88 case 'M': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
89 month = *(p + 2) == 'r' ? 2 : 4; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
90 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
91 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
92 case 'A': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
93 month = *(p + 1) == 'p' ? 3 : 7; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
94 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
95 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
96 case 'S': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
97 month = 8; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
98 break; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
99 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
100 case 'O': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
101 month = 9; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
102 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
103 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
104 case 'N': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
105 month = 10; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
106 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
107 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
108 case 'D': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
109 month = 11; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
110 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
111 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
112 default: |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
113 return NGX_ERROR; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
114 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
115 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
116 p += 3; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
117 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
118 if ((fmt == rfc822 && *p != ' ') || (fmt == rfc850 && *p != '-')) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
119 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
120 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
121 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
122 p++; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
123 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
124 if (fmt == rfc822) { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
125 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9' |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
126 || *(p + 2) < '0' || *(p + 2) > '9' |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
127 || *(p + 3) < '0' || *(p + 3) > '9') |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
128 { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
129 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
130 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
131 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
132 year = (*p - '0') * 1000 + (*(p + 1) - '0') * 100 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
133 + (*(p + 2) - '0') * 10 + *(p + 3) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
134 p += 4; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
135 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
136 } else if (fmt == rfc850) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
137 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
138 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
139 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
140 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
141 year = (*p - '0') * 10 + *(p + 1) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
142 year += (year < 70) ? 2000 : 1900; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
143 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
144 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
145 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
146 if (fmt == isoc) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
147 if (*p == ' ') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
148 p++; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
149 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
150 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
151 if (*p < '0' || *p > '9') { |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
152 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
153 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
154 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
155 day = *p++ - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
156 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
157 if (*p != ' ') { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
158 if (*p < '0' || *p > '9') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
159 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
160 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
161 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
162 day = day * 10 + *p++ - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
163 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
164 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
165 if (end - p < 14) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
166 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
167 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
168 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
169 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
170 if (*p++ != ' ') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
171 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
172 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
173 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
174 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
175 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
176 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
177 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
178 hour = (*p - '0') * 10 + *(p + 1) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
179 p += 2; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
180 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
181 if (*p++ != ':') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
182 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
183 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
184 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
185 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
186 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
187 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
188 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
189 min = (*p - '0') * 10 + *(p + 1) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
190 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
191 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
192 if (*p++ != ':') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
193 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
194 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
195 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
196 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
197 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
198 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
199 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
200 sec = (*p - '0') * 10 + *(p + 1) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
201 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
202 if (fmt == isoc) { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
203 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
204 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
205 if (*p++ != ' ') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
206 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
207 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
208 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
209 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9' |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
210 || *(p + 2) < '0' || *(p + 2) > '9' |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
211 || *(p + 3) < '0' || *(p + 3) > '9') |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
212 { |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
213 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
214 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
215 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
216 year = (*p - '0') * 1000 + (*(p + 1) - '0') * 100 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
217 + (*(p + 2) - '0') * 10 + *(p + 3) - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
218 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
219 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
220 if (hour > 23 || min > 59 || sec > 59) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
221 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
222 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
223 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
224 if (day == 29 && month == 1) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
225 if ((year & 3) || ((year % 100 == 0) && (year % 400) != 0)) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
226 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
227 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
228 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
229 } else if (day > mday[month]) { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
230 return NGX_ERROR; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
231 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
232 |
501 | 233 #if (NGX_TIME_T_SIZE <= 4) |
234 | |
235 if (year >= 2038) { | |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
236 return NGX_ERROR; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
237 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
238 |
501 | 239 #endif |
240 | |
181
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
241 /* |
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
242 * shift new year to March 1 and start months from 1 (not 0), |
1964 | 243 * it is needed for Gauss' formula |
181
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
244 */ |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
245 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
246 if (--month <= 0) { |
1062 | 247 month += 12; |
248 year -= 1; | |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
249 } |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
250 |
1964 | 251 /* Gauss' formula for Grigorian days since March 1, 1 BC */ |
252 | |
253 return ( | |
254 /* days in years including leap years since March 1, 1 BC */ | |
255 | |
256 365 * year + year / 4 - year / 100 + year / 400 | |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
257 |
1964 | 258 /* days before the month */ |
259 | |
260 + 367 * month / 12 - 30 | |
261 | |
262 /* days before the day */ | |
263 | |
264 + day - 1 | |
181
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
265 |
479 | 266 /* |
267 * 719527 days were between March 1, 1 BC and March 1, 1970, | |
1062 | 268 * 31 and 28 days were in January and February 1970 |
479 | 269 */ |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
270 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
271 - 719527 + 31 + 28) * 86400 + hour * 3600 + min * 60 + sec; |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
272 } |