1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
--TEST--
Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests)
--FILE--
<?php
print "TZ=America/Mendoza - wrong day.\n";
putenv("TZ=America/Mendoza");
$tStamp = mktime (17, 17, 17, 1, 8327, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Catamarca - wrong day.\n";
putenv("TZ=America/Catamarca");
$tStamp = mktime (17, 17, 17, 1, 7599, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Cordoba - wrong day.\n";
putenv("TZ=America/Cordoba");
$tStamp = mktime (17, 17, 17, 1, 7599, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Rosario - wrong day.\n";
putenv("TZ=America/Rosario");
$tStamp = mktime (17, 17, 17, 1, 7958, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Tuesday 00:00:00\n\n";
print "TZ=Europe/Vienna - wrong day - giving unexpected results, at
least on my system :-)\n";
putenv("TZ=Europe/Vienna");
$tStamp = mktime (17, 17, 17, 1, 3746, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Asia/Baku - wrong day.\n";
putenv("TZ=Asia/Baku");
$tStamp = mktime (17, 17, 17, 1, 8299, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Noronha - wrong day.\n";
putenv("TZ=America/Noronha");
$tStamp = mktime (17, 17, 17, 1, 10866, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=America/Havana - wrong day.\n";
putenv("TZ=America/Havana");
$tStamp = mktime (17, 17, 17, 1, 12720, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Europe/Tallinn - wrong day.\n";
putenv("TZ=Europe/Tallinn");
$tStamp = mktime (17, 17, 17, 1, 11777, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Saturday 00:00:00\n\n";
print "TZ=Asia/Jerusalem - wrong day.\n";
putenv("TZ=Asia/Jerusalem");
$tStamp = mktime (17, 17, 17, 1, 13056, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Europe/Vilnius - wrong day.\n";
putenv("TZ=Europe/Vilnius");
$tStamp = mktime (17, 17, 17, 1, 12140, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=Pacific/Kwajalein - wrong day.\n";
putenv("TZ=Pacific/Kwajalein");
$tStamp = mktime (17, 17, 17, 1, 8626, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=Asia/Ulan_Bator - wrong day.\n";
putenv("TZ=Asia/Ulan_Bator");
$tStamp = mktime (17, 17, 17, 1, 11588, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Saturday 00:00:00\n\n";
print "TZ=America/Cancun - wrong day.\n";
putenv("TZ=America/Cancun");
$tStamp = mktime (17, 17, 17, 1, 11785, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Mexico_City - wrong day.\n";
putenv("TZ=America/Mexico_City");
$tStamp = mktime (17, 17, 17, 1, 11781, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Wednesday 00:00:00\n\n";
print "TZ=America/Mazatlan - wrong day.\n";
putenv("TZ=America/Mazatlan");
$tStamp = mktime (17, 17, 17, 1, 11780, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Tuesday 00:00:00\n\n";
print "TZ=America/Chihuahua - wrong day.\n";
putenv("TZ=America/Chihuahua");
$tStamp = mktime (17, 17, 17, 1, 11782, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Asia/Kuala_Lumpur - wrong day.\n";
putenv("TZ=Asia/Kuala_Lumpur");
$tStamp = mktime (17, 17, 17, 1, 4380, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=Pacific/Chatham - wrong day.\n";
putenv("TZ=Pacific/Chatham");
$tStamp = mktime (17, 17, 17, 1, 1762, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=America/Lima - wrong day.\n";
putenv("TZ=America/Lima");
$tStamp = mktime (17, 17, 17, 1, 5839, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Asia/Karachi - wrong day.\n";
putenv("TZ=Asia/Karachi");
$tStamp = mktime (17, 17, 17, 1, 11783, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=America/Asuncion - wrong day.\n";
putenv("TZ=America/Asuncion");
$tStamp = mktime (17, 17, 17, 1, 11746, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Wednesday 00:00:00\n\n";
print "TZ=Asia/Singapore - wrong day.\n";
putenv("TZ=Asia/Singapore");
$tStamp = mktime (17, 17, 17, 1, 4383, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=America/Montevideo - wrong day.\n";
putenv("TZ=America/Montevideo");
$tStamp = mktime (17, 17, 17, 1, 12678, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
?>
--EXPECT--
TZ=America/Mendoza - wrong day.
tStamp=Sunday 1992-10-18 17:17:17 ARST 1
result=Sunday 1992-10-25 00:00:00 ARST 1
wanted=Sunday 00:00:00
TZ=America/Catamarca - wrong day.
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
result=Sunday 1990-10-28 00:00:00 ARST 1
wanted=Sunday 00:00:00
TZ=America/Cordoba - wrong day.
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
result=Sunday 1990-10-28 00:00:00 ARST 1
wanted=Sunday 00:00:00
TZ=America/Rosario - wrong day.
tStamp=Tuesday 1991-10-15 17:17:17 WART 0
result=Tuesday 1991-10-22 00:00:00 ARST 1
wanted=Tuesday 00:00:00
TZ=Europe/Vienna - wrong day - giving unexpected results, at
least on my system :-)
tStamp=Thursday 1980-04-03 17:17:17 CET 0
result=Thursday 1980-04-10 00:00:00 CEST 1
wanted=Thursday 00:00:00
TZ=Asia/Baku - wrong day.
tStamp=Sunday 1992-09-20 17:17:17 AZST 1
result=Sunday 1992-09-27 00:00:00 AZT 0
wanted=Sunday 00:00:00
TZ=America/Noronha - wrong day.
tStamp=Friday 1999-10-01 17:17:17 FNT 0
result=Friday 1999-10-08 00:00:00 FNST 1
wanted=Friday 00:00:00
TZ=America/Havana - wrong day.
tStamp=Thursday 2004-10-28 17:17:17 CDT 1
result=Thursday 2004-11-04 00:00:00 CDT 1
wanted=Thursday 00:00:00
TZ=Europe/Tallinn - wrong day.
tStamp=Saturday 2002-03-30 17:17:17 EET 0
result=Saturday 2002-04-06 00:00:00 EEST 1
wanted=Saturday 00:00:00
TZ=Asia/Jerusalem - wrong day.
tStamp=Thursday 2005-09-29 17:17:17 IDT 1
result=Thursday 2005-10-06 00:00:00 IDT 1
wanted=Thursday 00:00:00
TZ=Europe/Vilnius - wrong day.
tStamp=Friday 2003-03-28 17:17:17 EET 0
result=Friday 2003-04-04 00:00:00 EEST 1
wanted=Friday 00:00:00
TZ=Pacific/Kwajalein - wrong day.
tStamp=Friday 1993-08-13 17:17:17 KWAT 0
result=Saturday 1993-08-21 00:00:00 MHT 0
wanted=Friday 00:00:00
TZ=Asia/Ulan_Bator - wrong day.
tStamp=Saturday 2001-09-22 17:17:17 ULAST 1
result=Saturday 2001-09-29 00:00:00 ULAST 1
wanted=Saturday 00:00:00
TZ=America/Cancun - wrong day.
tStamp=Sunday 2002-04-07 17:17:17 CDT 1
result=Sunday 2002-04-14 00:00:00 CDT 1
wanted=Sunday 00:00:00
TZ=America/Mexico_City - wrong day.
tStamp=Wednesday 2002-04-03 17:17:17 CST 0
result=Wednesday 2002-04-10 00:00:00 CDT 1
wanted=Wednesday 00:00:00
TZ=America/Mazatlan - wrong day.
tStamp=Tuesday 2002-04-02 17:17:17 MST 0
result=Tuesday 2002-04-09 00:00:00 MDT 1
wanted=Tuesday 00:00:00
TZ=America/Chihuahua - wrong day.
tStamp=Thursday 2002-04-04 17:17:17 MST 0
result=Thursday 2002-04-11 00:00:00 MDT 1
wanted=Thursday 00:00:00
TZ=Asia/Kuala_Lumpur - wrong day.
tStamp=Monday 1981-12-28 17:17:17 MALT 0
result=Monday 1982-01-04 00:00:00 MYT 0
wanted=Monday 00:00:00
TZ=Pacific/Chatham - wrong day.
tStamp=Monday 1974-10-28 17:17:17 CHAST 0
result=Monday 1974-11-04 00:00:00 CHADT 1
wanted=Monday 00:00:00
TZ=America/Lima - wrong day.
tStamp=Thursday 1985-12-26 17:17:17 PET 0
result=Thursday 1986-01-02 00:00:00 PEST 1
wanted=Thursday 00:00:00
TZ=Asia/Karachi - wrong day.
tStamp=Friday 2002-04-05 17:17:17 PKT 0
result=Friday 2002-04-12 00:00:00 PKST 1
wanted=Friday 00:00:00
TZ=America/Asuncion - wrong day.
tStamp=Wednesday 2002-02-27 17:17:17 PYST 1
result=Wednesday 2002-03-06 00:00:00 PYST 1
wanted=Wednesday 00:00:00
TZ=Asia/Singapore - wrong day.
tStamp=Thursday 1981-12-31 17:17:17 SGT 0
result=Thursday 1982-01-07 00:00:00 SGT 0
wanted=Thursday 00:00:00
TZ=America/Montevideo - wrong day.
tStamp=Thursday 2004-09-16 17:17:17 UYT 0
result=Thursday 2004-09-23 00:00:00 UYST 1
wanted=Thursday 00:00:00
|