Annotation of embedaddon/php/ext/date/tests/DateTime_data-spring-type2-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, Spring, Zone Type 2 to Zone Type 2
13: *
14: * + prev: the day before the transition day 2010-03-13 18:38:28 EST
15: * + st: standard time on transition day 2010-03-14 00:10:20 EST
16: * + dt: daylight time on the transition day 2010-03-14 03:16:55 EDT
17: * + post: the day after the transition day 2010-03-15 19:59:59 EDT
18: * + stsec: standard time 1 sec before change 2010-03-14 01:59:59 EST
19: * + dtsec: daylight time first second 2010-03-14 03:00:00 EDT
20: */
21: echo "test_time_spring_type2_prev_type2_prev: ";
22: $end = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
23: $start = new DateTime('2010-02-11 02:18:48 EST'); // sp prev, zt2
24: examine_diff($end, $start, 'P+0Y1M2DT16H19M40S', 30);
25:
26: echo "test_time_spring_type2_prev_type2_st: ";
27: $end = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
28: $start = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
29: examine_diff($end, $start, 'P+0Y0M0DT5H31M52S', 0);
30:
31: echo "test_time_spring_type2_prev_type2_dt: ";
32: $end = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
33: $start = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
34: examine_diff($end, $start, 'P+0Y0M0DT7H38M27S', 0);
35:
36: echo "test_time_spring_type2_prev_type2_post: ";
37: $end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
38: $start = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
39: examine_diff($end, $start, 'P+0Y0M2DT1H21M31S', 2);
40:
41: echo "test_time_spring_type2_st_type2_prev: ";
42: $end = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
43: $start = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
44: examine_diff($end, $start, 'P-0Y0M0DT5H31M52S', 0);
45:
46: echo "test_time_spring_type2_st_type2_st: ";
47: $end = new DateTime('2010-03-14 00:15:35 EST'); // sp st, zt2
48: $start = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
49: examine_diff($end, $start, 'P+0Y0M0DT0H5M15S', 0);
50:
51: echo "test_time_spring_type2_st_type2_dt: ";
52: $end = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
53: $start = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
54: examine_diff($end, $start, 'P+0Y0M0DT2H6M35S', 0);
55:
56: echo "test_time_spring_type2_st_type2_post: ";
57: $end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
58: $start = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
59: examine_diff($end, $start, 'P+0Y0M1DT18H49M39S', 1);
60:
61: echo "test_time_spring_type2_dt_type2_prev: ";
62: $end = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
63: $start = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
64: examine_diff($end, $start, 'P-0Y0M0DT7H38M27S', 0);
65:
66: echo "test_time_spring_type2_dt_type2_st: ";
67: $end = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
68: $start = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
69: examine_diff($end, $start, 'P-0Y0M0DT2H6M35S', 0);
70:
71: echo "test_time_spring_type2_dt_type2_dt: ";
72: $end = new DateTime('2010-03-14 05:19:56 EDT'); // sp dt, zt2
73: $start = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
74: examine_diff($end, $start, 'P+0Y0M0DT2H3M1S', 0);
75:
76: echo "test_time_spring_type2_dt_type2_post: ";
77: $end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
78: $start = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
79: examine_diff($end, $start, 'P+0Y0M1DT16H43M4S', 1);
80:
81: echo "test_time_spring_type2_post_type2_prev: ";
82: $end = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
83: $start = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
84: examine_diff($end, $start, 'P-0Y0M2DT1H21M31S', 2);
85:
86: echo "test_time_spring_type2_post_type2_st: ";
87: $end = new DateTime('2010-03-14 00:10:20 EST'); // st, zt2
88: $start = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
89: examine_diff($end, $start, 'P-0Y0M1DT18H49M39S', 1);
90:
91: echo "test_time_spring_type2_post_type2_dt: ";
92: $end = new DateTime('2010-03-14 03:16:55 EDT'); // dt, zt2
93: $start = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
94: examine_diff($end, $start, 'P-0Y0M1DT16H43M4S', 1);
95:
96: echo "test_time_spring_type2_post_type2_post: ";
97: $end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
98: $start = new DateTime('2010-03-15 18:57:55 EDT'); // sp post, zt2
99: examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
100:
101: echo "test_time_spring_type2_stsec_type2_dtsec: ";
102: $end = new DateTime('2010-03-14 03:00:00 EDT'); // dtsec, zt2
103: $start = new DateTime('2010-03-14 01:59:59 EST'); // stsec, zt2
104: examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
105:
106: echo "test_time_spring_type2_dtsec_type2_stsec: ";
107: $end = new DateTime('2010-03-14 01:59:59 EST'); // stsec, zt2
108: $start = new DateTime('2010-03-14 03:00:00 EDT'); // dtsec, zt2
109: examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>