Annotation of embedaddon/php/ext/date/tests/DateTime_data-fall-type3-type2.inc, revision 1.1.1.1
1.1 misho 1: <?php
2:
3: /*
4: * Note: test names match method names in a set of PHPUnit tests
5: * in a userland package. Please be so kind as to leave them.
6: */
7:
8: date_default_timezone_set('America/New_York');
9:
10:
11: /*
12: * Time, Fall, Zone Type 3 to Zone Type 2
13: *
14: * + prev: the day before the transition day 2010-11-06 18:38:28 EDT
15: * + dt: daylight time on transition day 2010-11-07 00:10:20 EDT
16: * + redodt: daylight time in the redo period 2010-11-07 01:12:33 EDT
17: * + redost: standard time in the redo period 2010-11-07 01:14:44 EST
18: * + st: standard time on the transition day 2010-11-07 03:16:55 EST
19: * + post: the day after the transition day 2010-11-08 19:59:59 EST
20: * + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT
21: * + stsec: standard time first second 2010-11-07 01:00:00 EST
22: */
23: echo "test_time_fall_type3_prev_type2_prev: ";
24: $end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
25: $start = new DateTime('2010-10-04 02:18:48'); // sp prev, zt3
26: examine_diff($end, $start, 'P+0Y1M2DT16H19M40S', 33);
27:
28: echo "test_time_fall_type3_prev_type2_dt: ";
29: $end = new DateTime('2010-11-07 00:10:20 EDT'); // dt, zt2
30: $start = new DateTime('2010-11-06 18:38:28'); // prev, zt3
31: examine_diff($end, $start, 'P+0Y0M0DT5H31M52S', 0);
32:
33: echo "test_time_fall_type3_prev_type2_redodt: ";
34: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
35: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
36: $start = new DateTime('2010-11-06 18:38:28'); // prev, zt3
37: examine_diff($end, $start, 'P+0Y0M0DT6H34M5S', 0);
38:
39: echo "test_time_fall_type3_prev_type2_redost: ";
40: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
41: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
42: $start = new DateTime('2010-11-06 18:38:28'); // prev, zt3
43: examine_diff($end, $start, 'P+0Y0M0DT7H36M16S', 0);
44:
45: echo "test_time_fall_type3_prev_type2_st: ";
46: $end = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
47: $start = new DateTime('2010-11-06 18:38:28'); // prev, zt3
48: examine_diff($end, $start, 'P+0Y0M0DT9H38M27S', 0);
49:
50: echo "test_time_fall_type3_prev_type2_post: ";
51: $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
52: $start = new DateTime('2010-11-06 18:38:28'); // prev, zt3
53: examine_diff($end, $start, 'P+0Y0M2DT1H21M31S', 2);
54:
55: echo "test_time_fall_type3_dt_type2_prev: ";
56: $end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
57: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
58: examine_diff($end, $start, 'P-0Y0M0DT5H31M52S', 0);
59:
60: echo "test_time_fall_type3_dt_type2_dt: ";
61: $end = new DateTime('2010-11-07 00:15:35 EDT'); // sp dt, zt2
62: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
63: examine_diff($end, $start, 'P+0Y0M0DT0H5M15S', 0);
64:
65: echo "test_time_fall_type3_dt_type2_redodt: ";
66: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
67: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
68: examine_diff($end, $start, 'P+0Y0M0DT1H2M13S', 0);
69:
70: echo "test_time_fall_type3_dt_type2_redost: ";
71: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
72: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
73: examine_diff($end, $start, 'P+0Y0M0DT2H4M24S', 0);
74:
75: echo "test_time_fall_type3_dt_type2_st: ";
76: $end = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
77: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
78: examine_diff($end, $start, 'P+0Y0M0DT4H6M35S', 0);
79:
80: echo "test_time_fall_type3_dt_type2_post: ";
81: $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
82: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
83: examine_diff($end, $start, 'P+0Y0M1DT20H49M39S', 1);
84:
85: echo "test_time_fall_type3_redodt_type2_prev: ";
86: $end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
87: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
88: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
89: examine_diff($end, $start, 'P-0Y0M0DT6H34M5S', 0);
90:
91: echo "test_time_fall_type3_redodt_type2_dt: ";
92: $end = new DateTime('2010-11-07 00:10:20 EDT'); // dt, zt2
93: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
94: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
95: examine_diff($end, $start, 'P-0Y0M0DT1H2M13S', 0);
96:
97: echo "test_time_fall_type3_redodt_type2_redodt: ";
98: $end = new DateTime('2010-11-07 01:15:35 EDT'); // sp redodt, zt2
99: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
100: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
101: examine_diff($end, $start, 'P+0Y0M0DT0H3M2S', 0);
102:
103: echo "test_time_fall_type3_redodt_type2_redost: ";
104: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
105: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
106: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
107: examine_diff($end, $start, 'P+0Y0M0DT1H2M11S', 0);
108:
109: echo "test_time_fall_type3_redodt_type2_st: ";
110: $end = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
111: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
112: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
113: examine_diff($end, $start, 'P+0Y0M0DT3H4M22S', 0);
114:
115: echo "test_time_fall_type3_redodt_type2_post: ";
116: $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
117: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
118: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
119: examine_diff($end, $start, 'P+0Y0M1DT19H47M26S', 1);
120:
121: echo "test_time_fall_type3_redost_type2_prev: ";
122: $end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
123: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
124: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
125: examine_diff($end, $start, 'P-0Y0M0DT7H36M16S', 0);
126:
127: echo "test_time_fall_type3_redost_type2_dt: ";
128: $end = new DateTime('2010-11-07 00:10:20 EDT'); // dt, zt2
129: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
130: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
131: examine_diff($end, $start, 'P-0Y0M0DT2H4M24S', 0);
132:
133: echo "test_time_fall_type3_redost_type2_redodt: ";
134: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
135: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
136: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
137: examine_diff($end, $start, 'P-0Y0M0DT1H2M11S', 0);
138:
139: echo "test_time_fall_type3_redost_type2_redost: ";
140: $end = new DateTime('2010-11-07 01:16:54 EST'); // sp redodt, zt2
141: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
142: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
143: examine_diff($end, $start, 'P+0Y0M0DT0H2M10S', 0);
144:
145: echo "test_time_fall_type3_redost_type2_st: ";
146: $end = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
147: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
148: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
149: examine_diff($end, $start, 'P+0Y0M0DT2H2M11S', 0);
150:
151: echo "test_time_fall_type3_redost_type2_post: ";
152: $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
153: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
154: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
155: examine_diff($end, $start, 'P+0Y0M1DT18H45M15S', 1);
156:
157: echo "test_time_fall_type3_st_type2_prev: ";
158: $end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
159: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
160: examine_diff($end, $start, 'P-0Y0M0DT9H38M27S', 0);
161:
162: echo "test_time_fall_type3_st_type2_dt: ";
163: $end = new DateTime('2010-11-07 00:10:20 EDT'); // dt, zt2
164: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
165: examine_diff($end, $start, 'P-0Y0M0DT4H6M35S', 0);
166:
167: echo "test_time_fall_type3_st_type2_redodt: ";
168: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
169: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
170: examine_diff($end, $start, 'P-0Y0M0DT3H4M22S', 0);
171:
172: echo "test_time_fall_type3_st_type2_redost: ";
173: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
174: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
175: examine_diff($end, $start, 'P-0Y0M0DT2H2M11S', 0);
176:
177: echo "test_time_fall_type3_st_type2_st: ";
178: $end = new DateTime('2010-11-07 05:19:56 EST'); // sp st, zt2
179: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
180: examine_diff($end, $start, 'P+0Y0M0DT2H3M1S', 0);
181:
182: echo "test_time_fall_type3_st_type2_post: ";
183: $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
184: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
185: examine_diff($end, $start, 'P+0Y0M1DT16H43M4S', 1);
186:
187: echo "test_time_fall_type3_post_type2_prev: ";
188: $end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
189: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
190: examine_diff($end, $start, 'P-0Y0M2DT1H21M31S', 2);
191:
192: echo "test_time_fall_type3_post_type2_dt: ";
193: $end = new DateTime('2010-11-07 00:10:20 EDT'); // dt, zt2
194: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
195: examine_diff($end, $start, 'P-0Y0M1DT20H49M39S', 1);
196:
197: echo "test_time_fall_type3_post_type2_redodt: ";
198: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
199: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
200: examine_diff($end, $start, 'P-0Y0M1DT19H47M26S', 1);
201:
202: echo "test_time_fall_type3_post_type2_redost: ";
203: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
204: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
205: examine_diff($end, $start, 'P-0Y0M1DT18H45M15S', 1);
206:
207: echo "test_time_fall_type3_post_type2_st: ";
208: $end = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
209: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
210: examine_diff($end, $start, 'P-0Y0M1DT16H43M4S', 1);
211:
212: echo "test_time_fall_type3_post_type2_post: ";
213: $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
214: $start = new DateTime('2010-11-08 18:57:55'); // sp post, zt3
215: examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
216:
217: echo "test_time_fall_type3_dtsec_type2_stsec: ";
218: $end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
219: $start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
220: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
221: examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
222:
223: echo "test_time_fall_type3_stsec_type2_dtsec: ";
224: $end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
225: $start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
226: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
227: examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>