Mercurial > hg > nginx-quic
annotate src/http/ngx_http_parse_time.c @ 1562:bb662e047a21
allow access_log inside limit_except
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 09 Oct 2007 18:45:49 +0000 |
parents | bc9751affada |
children | 8d3d224cae20 |
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 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
181
diff
changeset
|
14 time_t 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
|
15 { |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
181
diff
changeset
|
16 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
|
17 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
|
18 enum { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
19 no = 0, |
684 | 20 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
|
21 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
|
22 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
|
23 } fmt; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
24 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
25 fmt = 0; |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
26 end = value + len; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
27 |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
28 #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
|
29 day = 32; |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
30 year = 2038; |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
31 #endif |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
32 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
33 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
|
34 if (*p == ',') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
35 break; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
36 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
37 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
38 if (*p == ' ') { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
39 fmt = isoc; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
40 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
41 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
42 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
44 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
|
45 if (*p != ' ') { |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
46 break; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
47 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
49 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
|
50 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
|
51 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
52 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
53 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
|
54 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
|
55 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
|
56 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
57 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
58 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
|
59 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
60 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
61 if (*p == ' ') { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
62 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
|
63 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
|
64 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
65 fmt = rfc822; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
66 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
67 } else if (*p == '-') { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
68 fmt = rfc850; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
69 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
70 } else { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
71 return NGX_ERROR; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
72 } |
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 p++; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
75 } |
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 switch (*p) { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
78 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
79 case 'J': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
80 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
|
81 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
82 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
83 case 'F': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
84 month = 1; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
85 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
86 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
87 case 'M': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
88 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
|
89 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
90 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
91 case 'A': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
92 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
|
93 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
94 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
95 case 'S': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
96 month = 8; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
97 break; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
98 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
99 case 'O': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
100 month = 9; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
101 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
102 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
103 case 'N': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
104 month = 10; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
105 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
106 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
107 case 'D': |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
108 month = 11; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
109 break; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
110 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
111 default: |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
112 return NGX_ERROR; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
113 } |
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 p += 3; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
116 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
117 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
|
118 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
|
119 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
120 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
121 p++; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
122 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
123 if (fmt == rfc822) { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
124 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
|
125 || *(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
|
126 || *(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
|
127 { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
128 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
|
129 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
130 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
131 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
|
132 + (*(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
|
133 p += 4; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
134 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
135 } 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
|
136 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
|
137 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
|
138 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
139 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
140 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
|
141 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
|
142 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
143 } |
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 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
|
146 if (*p == ' ') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
147 p++; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
148 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
149 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
150 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
|
151 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
|
152 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
153 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
154 day = *p++ - '0'; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
155 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
156 if (*p != ' ') { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
157 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
|
158 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
|
159 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
160 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
161 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
|
162 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
163 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
164 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
|
165 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
|
166 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
167 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
168 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
169 if (*p++ != ' ') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
170 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
|
171 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
172 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
173 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
|
174 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
|
175 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
176 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
177 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
|
178 p += 2; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
179 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
180 if (*p++ != ':') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
181 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
|
182 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
183 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
184 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
|
185 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
|
186 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
187 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
188 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
|
189 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
190 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
191 if (*p++ != ':') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
192 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
|
193 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
194 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
195 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
|
196 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
|
197 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
198 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
199 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
|
200 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
201 if (fmt == isoc) { |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
202 p += 2; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
203 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
204 if (*p++ != ' ') { |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
205 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
|
206 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
207 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
208 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
|
209 || *(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
|
210 || *(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
|
211 { |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
212 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
|
213 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
214 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
215 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
|
216 + (*(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
|
217 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
218 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
29
diff
changeset
|
219 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
|
220 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
|
221 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
222 |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
223 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
|
224 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
|
225 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
|
226 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
227 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
228 } 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
|
229 return NGX_ERROR; |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
230 } |
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
231 |
501 | 232 #if (NGX_TIME_T_SIZE <= 4) |
233 | |
234 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
|
235 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
|
236 } |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
237 |
501 | 238 #endif |
239 | |
181
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
240 /* |
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
241 * shift new year to March 1 and start months from 1 (not 0), |
479 | 242 * it is needed for Gauss's formula |
181
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
243 */ |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
244 |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
245 if (--month <= 0) { |
1062 | 246 month += 12; |
247 year -= 1; | |
25
a8b156554dfe
nginx-0.0.1-2002-12-11-19:57:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
248 } |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
249 |
479 | 250 /* Gauss's formula for Grigorian days from 1 March 1 BC */ |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
251 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
252 return (365 * year + year / 4 - year / 100 + year / 400 |
181
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
253 + 367 * month / 12 - 31 |
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
254 + day |
811bdd2af794
nginx-0.0.1-2003-11-12-20:25:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
255 |
479 | 256 /* |
257 * 719527 days were between March 1, 1 BC and March 1, 1970, | |
1062 | 258 * 31 and 28 days were in January and February 1970 |
479 | 259 */ |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
260 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
25
diff
changeset
|
261 - 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
|
262 } |