Annotation of embedaddon/php/ext/date/tests/DateTime_data-fall-type2-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 2 to Zone Type 3
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_type2_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 EDT'); // sp prev, zt2
26: examine_diff($end, $start, 'P+0Y1M2DT16H19M40S', 33);
27:
28: echo "test_time_fall_type2_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 EDT'); // prev, zt2
31: examine_diff($end, $start, 'P+0Y0M0DT5H31M52S', 0);
32:
33: echo "test_time_fall_type2_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 EDT'); // prev, zt2
37: examine_diff($end, $start, 'P+0Y0M0DT6H34M5S', 0);
38:
39: echo "test_time_fall_type2_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 EDT'); // prev, zt2
43: examine_diff($end, $start, 'P+0Y0M0DT7H36M16S', 0);
44:
45: echo "test_time_fall_type2_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 EDT'); // prev, zt2
48: examine_diff($end, $start, 'P+0Y0M0DT9H38M27S', 0);
49:
50: echo "test_time_fall_type2_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 EDT'); // prev, zt2
53: examine_diff($end, $start, 'P+0Y0M2DT1H21M31S', 2);
54:
55: echo "test_time_fall_type2_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 EDT'); // dt, zt2
58: examine_diff($end, $start, 'P-0Y0M0DT5H31M52S', 0);
59:
60: echo "test_time_fall_type2_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 EDT'); // dt, zt2
63: examine_diff($end, $start, 'P+0Y0M0DT0H5M15S', 0);
64:
65: echo "test_time_fall_type2_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 EDT'); // dt, zt2
69: examine_diff($end, $start, 'P+0Y0M0DT1H2M13S', 0);
70:
71: echo "test_time_fall_type2_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 EDT'); // dt, zt2
75: examine_diff($end, $start, 'P+0Y0M0DT2H4M24S', 0);
76:
77: echo "test_time_fall_type2_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 EDT'); // dt, zt2
80: examine_diff($end, $start, 'P+0Y0M0DT4H6M35S', 0);
81:
82: echo "test_time_fall_type2_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 EDT'); // dt, zt2
85: examine_diff($end, $start, 'P+0Y0M1DT20H49M39S', 1);
86:
87: echo "test_time_fall_type2_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: examine_diff($end, $start, 'P-0Y0M0DT6H34M5S', 0);
91:
92: echo "test_time_fall_type2_redodt_type3_dt: ";
93: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
94: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
95: examine_diff($end, $start, 'P-0Y0M0DT1H2M13S', 0);
96:
97: echo "test_time_fall_type2_redodt_type3_redodt: ";
98: $end = new DateTime('2010-11-07 01:15:35 EDT'); // sp redodt, zt2
99: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
100: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
101: examine_diff($end, $start, 'P+0Y0M0DT0H3M2S', 0);
102:
103: echo "test_time_fall_type2_redodt_type3_redost: ";
104: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
105: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
106: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
107: examine_diff($end, $start, 'P+0Y0M0DT1H2M11S', 0);
108:
109: echo "test_time_fall_type2_redodt_type3_st: ";
110: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
111: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
112: examine_diff($end, $start, 'P+0Y0M0DT3H4M22S', 0);
113:
114: echo "test_time_fall_type2_redodt_type3_post: ";
115: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
116: $start = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
117: examine_diff($end, $start, 'P+0Y0M1DT19H47M26S', 1);
118:
119: echo "test_time_fall_type2_redost_type3_prev: ";
120: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
121: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
122: examine_diff($end, $start, 'P-0Y0M0DT7H36M16S', 0);
123:
124: echo "test_time_fall_type2_redost_type3_dt: ";
125: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
126: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
127: examine_diff($end, $start, 'P-0Y0M0DT2H4M24S', 0);
128:
129: echo "test_time_fall_type2_redost_type3_redodt: ";
130: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
131: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
132: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
133: examine_diff($end, $start, 'P-0Y0M0DT1H2M11S', 0);
134:
135: echo "test_time_fall_type2_redost_type3_redost: ";
136: $end = new DateTime('2010-11-07 01:16:54 EST'); // sp redodt, zt2
137: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
138: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
139: examine_diff($end, $start, 'P+0Y0M0DT0H2M10S', 0);
140:
141: echo "test_time_fall_type2_redost_type3_st: ";
142: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
143: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
144: examine_diff($end, $start, 'P+0Y0M0DT2H2M11S', 0);
145:
146: echo "test_time_fall_type2_redost_type3_post: ";
147: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
148: $start = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
149: examine_diff($end, $start, 'P+0Y0M1DT18H45M15S', 1);
150:
151: echo "test_time_fall_type2_st_type3_prev: ";
152: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
153: $start = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
154: examine_diff($end, $start, 'P-0Y0M0DT9H38M27S', 0);
155:
156: echo "test_time_fall_type2_st_type3_dt: ";
157: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
158: $start = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
159: examine_diff($end, $start, 'P-0Y0M0DT4H6M35S', 0);
160:
161: echo "test_time_fall_type2_st_type3_redodt: ";
162: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
163: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
164: $start = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
165: examine_diff($end, $start, 'P-0Y0M0DT3H4M22S', 0);
166:
167: echo "test_time_fall_type2_st_type3_redost: ";
168: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
169: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
170: $start = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
171: examine_diff($end, $start, 'P-0Y0M0DT2H2M11S', 0);
172:
173: echo "test_time_fall_type2_st_type3_st: ";
174: $end = new DateTime('2010-11-07 05:19:56'); // sp st, zt3
175: $start = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
176: examine_diff($end, $start, 'P+0Y0M0DT2H3M1S', 0);
177:
178: echo "test_time_fall_type2_st_type3_post: ";
179: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
180: $start = new DateTime('2010-11-07 03:16:55 EST'); // st, zt2
181: examine_diff($end, $start, 'P+0Y0M1DT16H43M4S', 1);
182:
183: echo "test_time_fall_type2_post_type3_prev: ";
184: $end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
185: $start = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
186: examine_diff($end, $start, 'P-0Y0M2DT1H21M31S', 2);
187:
188: echo "test_time_fall_type2_post_type3_dt: ";
189: $end = new DateTime('2010-11-07 00:10:20'); // dt, zt3
190: $start = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
191: examine_diff($end, $start, 'P-0Y0M1DT20H49M39S', 1);
192:
193: echo "test_time_fall_type2_post_type3_redodt: ";
194: $end = new DateTime('2010-11-07 01:12:33 EDT'); // redodt, zt2
195: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
196: $start = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
197: examine_diff($end, $start, 'P-0Y0M1DT19H47M26S', 1);
198:
199: echo "test_time_fall_type2_post_type3_redost: ";
200: $end = new DateTime('2010-11-07 01:14:44 EST'); // redost, zt2
201: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
202: $start = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
203: examine_diff($end, $start, 'P-0Y0M1DT18H45M15S', 1);
204:
205: echo "test_time_fall_type2_post_type3_st: ";
206: $end = new DateTime('2010-11-07 03:16:55'); // st, zt3
207: $start = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
208: examine_diff($end, $start, 'P-0Y0M1DT16H43M4S', 1);
209:
210: echo "test_time_fall_type2_post_type3_post: ";
211: $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
212: $start = new DateTime('2010-11-08 18:57:55 EST'); // sp post, zt2
213: examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
214:
215: echo "test_time_fall_type2_dtsec_type3_stsec: ";
216: $end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
217: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
218: $start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
219: examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
220:
221: echo "test_time_fall_type2_stsec_type3_dtsec: ";
222: $end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
223: $end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
224: $start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
225: examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>