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