Annotation of embedaddon/php/ext/date/tests/DateTime_data-fall-type3-type3.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 3
13: *
14: * + prev: the day before the transition day 2010-11-06 18:38:28
15: * + dt: daylight time on transition day 2010-11-07 00:10:20
16: * + redodt: daylight time in the redo period 2010-11-07 01:12:33 EDT, + TZ
17: * + redost: standard time in the redo period 2010-11-07 01:14:44 EST, + TZ
18: * + st: standard time on the transition day 2010-11-07 03:16:55
19: * + post: the day after the transition day 2010-11-08 19:59:59
20: * + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT, + TZ
21: * + stsec: standard time first second 2010-11-07 01:00:00 EST, + TZ
22: */
23: echo "test_time_fall_type3_prev_type3_prev: ";
24: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
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_type3_dt: ";
29: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
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_type3_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_type3_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_type3_st: ";
46: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
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_type3_post: ";
51: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
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_type3_prev: ";
56: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
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_type3_dt: ";
61: $end = new DateTime('2010-11-07 00:15:35'); // sp dt, zt3
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_type3_redodt: ";
66: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
67: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
68: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
69: examine_diff($end, $start, 'P+0Y0M0DT1H2M13S', 0);
70:
71: echo "test_time_fall_type3_dt_type3_redost: ";
72: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
73: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
74: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
75: examine_diff($end, $start, 'P+0Y0M0DT2H4M24S', 0);
76:
77: echo "test_time_fall_type3_dt_type3_st: ";
78: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
79: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
80: examine_diff($end, $start, 'P+0Y0M0DT4H6M35S', 0);
81:
82: echo "test_time_fall_type3_dt_type3_post: ";
83: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
84: $start = new DateTime('2010-11-07 00:10:20'); // dt, zt3
85: examine_diff($end, $start, 'P+0Y0M1DT20H49M39S', 1);
86:
87: echo "test_time_fall_type3_redodt_type3_prev: ";
88: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
89: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
90: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
91: examine_diff($end, $start, 'P-0Y0M0DT6H34M5S', 0);
92:
93: echo "test_time_fall_type3_redodt_type3_dt: ";
94: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
95: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
96: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
97: examine_diff($end, $start, 'P-0Y0M0DT1H2M13S', 0);
98:
99: echo "test_time_fall_type3_redodt_type3_redodt: ";
100: $end = new DateTime('2010-11-07 01:15:35 EDT'); // sp redodt, zt2
101: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
102: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
103: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
104: examine_diff($end, $start, 'P+0Y0M0DT0H3M2S', 0);
105:
106: echo "test_time_fall_type3_redodt_type3_redost: ";
107: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
108: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
109: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
110: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
111: examine_diff($end, $start, 'P+0Y0M0DT1H2M11S', 0);
112:
113: echo "test_time_fall_type3_redodt_type3_st: ";
114: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
115: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
116: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
117: examine_diff($end, $start, 'P+0Y0M0DT3H4M22S', 0);
118:
119: echo "test_time_fall_type3_redodt_type3_post: ";
120: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
121: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
122: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
123: examine_diff($end, $start, 'P+0Y0M1DT19H47M26S', 1);
124:
125: echo "test_time_fall_type3_redost_type3_prev: ";
126: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
127: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
128: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
129: examine_diff($end, $start, 'P-0Y0M0DT7H36M16S', 0);
130:
131: echo "test_time_fall_type3_redost_type3_dt: ";
132: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
133: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
134: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
135: examine_diff($end, $start, 'P-0Y0M0DT2H4M24S', 0);
136:
137: echo "test_time_fall_type3_redost_type3_redodt: ";
138: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
139: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
140: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
141: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
142: examine_diff($end, $start, 'P-0Y0M0DT1H2M11S', 0);
143:
144: echo "test_time_fall_type3_redost_type3_redost: ";
145: $end = new DateTime('2010-11-07 01:16:54 EST'); // sp redodt, zt2
146: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
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+0Y0M0DT0H2M10S', 0);
150:
151: echo "test_time_fall_type3_redost_type3_st: ";
152: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
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+0Y0M0DT2H2M11S', 0);
156:
157: echo "test_time_fall_type3_redost_type3_post: ";
158: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
159: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
160: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
161: examine_diff($end, $start, 'P+0Y0M1DT18H45M15S', 1);
162:
163: echo "test_time_fall_type3_st_type3_prev: ";
164: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
165: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
166: examine_diff($end, $start, 'P-0Y0M0DT9H38M27S', 0);
167:
168: echo "test_time_fall_type3_st_type3_dt: ";
169: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
170: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
171: examine_diff($end, $start, 'P-0Y0M0DT4H6M35S', 0);
172:
173: echo "test_time_fall_type3_st_type3_redodt: ";
174: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
175: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
176: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
177: examine_diff($end, $start, 'P-0Y0M0DT3H4M22S', 0);
178:
179: echo "test_time_fall_type3_st_type3_redost: ";
180: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
181: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
182: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
183: examine_diff($end, $start, 'P-0Y0M0DT2H2M11S', 0);
184:
185: echo "test_time_fall_type3_st_type3_st: ";
186: $end = new DateTime('2010-11-07 05:19:56'); // sp st, zt3
187: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
188: examine_diff($end, $start, 'P+0Y0M0DT2H3M1S', 0);
189:
190: echo "test_time_fall_type3_st_type3_post: ";
191: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
192: $start = new DateTime('2010-11-07 03:16:55'); // st, zt3
193: examine_diff($end, $start, 'P+0Y0M1DT16H43M4S', 1);
194:
195: echo "test_time_fall_type3_post_type3_prev: ";
196: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
197: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
198: examine_diff($end, $start, 'P-0Y0M2DT1H21M31S', 2);
199:
200: echo "test_time_fall_type3_post_type3_dt: ";
201: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
202: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
203: examine_diff($end, $start, 'P-0Y0M1DT20H49M39S', 1);
204:
205: echo "test_time_fall_type3_post_type3_redodt: ";
206: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
207: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
208: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
209: examine_diff($end, $start, 'P-0Y0M1DT19H47M26S', 1);
210:
211: echo "test_time_fall_type3_post_type3_redost: ";
212: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
213: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
214: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
215: examine_diff($end, $start, 'P-0Y0M1DT18H45M15S', 1);
216:
217: echo "test_time_fall_type3_post_type3_st: ";
218: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
219: $start = new DateTime('2010-11-08 19:59:59'); // post, zt3
220: examine_diff($end, $start, 'P-0Y0M1DT16H43M4S', 1);
221:
222: echo "test_time_fall_type3_post_type3_post: ";
223: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
224: $start = new DateTime('2010-11-08 18:57:55'); // sp post, zt3
225: examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
226:
227: echo "test_time_fall_type3_dtsec_type3_stsec: ";
228: $end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
229: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
230: $start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
231: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
232: examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
233:
234: echo "test_time_fall_type3_stsec_type3_dtsec: ";
235: $end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
236: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
237: $start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
238: $start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
239: examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>