Annotation of embedaddon/php/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fa)
3: --CREDITS--
4: Daniel Convissor <danielc@php.net>
5: --FILE--
6: <?php
7:
8: date_default_timezone_set('America/New_York');
9: $date_format = 'Y-m-d H:i:s T e';
10: $interval_format = 'P%dDT%hH';
11:
12: /*
13: * Forward Transitions, add().
14: */
15:
16: $start = new DateTime('2010-03-14 01:59:59');
17: $interval_spec = 'PT1S';
18: $interval = new DateInterval($interval_spec);
19: echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
20: . $start->add($interval)->format($date_format) . "\n";
21:
22: $start = new DateTime('2010-03-13 04:30:00');
23: $interval_spec = 'P1D';
24: $interval = new DateInterval($interval_spec);
25: echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
26: . $start->add($interval)->format($date_format) . "\n";
27:
28: $start = new DateTime('2010-03-13 04:30:00');
29: $interval_spec = 'PT22H';
30: $interval = new DateInterval($interval_spec);
31: echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
32: . $start->add($interval)->format($date_format) . "\n";
33:
34: $start = new DateTime('2010-03-13 04:30:00');
35: $interval_spec = 'PT21H';
36: $interval = new DateInterval($interval_spec);
37: echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
38: . $start->add($interval)->format($date_format) . "\n";
39:
40: $start = new DateTime('2010-03-13 01:30:00');
41: $interval_spec = 'P1D';
42: $interval = new DateInterval($interval_spec);
43: echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
44: . $start->add($interval)->format($date_format) . "\n";
45:
46: $start = new DateTime('2010-03-13 02:30:00');
47: $interval_spec = 'P1D';
48: $interval = new DateInterval($interval_spec);
49: echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
50: . $start->add($interval)->format($date_format) . "\n";
51: ?>
52: --EXPECT--
53: fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
54: fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
55: fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
56: fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
57: fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
58: fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>