PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Expected Test Failure Report for ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt ('RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2)')

Script

1: <?php
2:
3: date_default_timezone_set
('America/New_York');
4:
$date_format 'Y-m-d H:i:s T e';
5:
$interval_format 'P%dDT%hH';
6:
7:
/*
8:  * For backward transitions, must create objects with zone type 2
9:  * where specifying Daylight or Standard time is required
10:  * then converting them to zone type 3.
11:  */
12:
13:
$tz = new DateTimeZone('America/New_York');
14:
15:
/*
16:  * Backward Transitions, diff().
17:  */
18:
19:
$end   = new DateTime('2010-11-07 05:30:00');
20:
$end->setTimeZone($tz);
21:
$start = new DateTime('2010-11-06 04:30:59');
22: echo 
'bd0 ' $end->format($date_format) . ' - ' $start->format($date_format)
23:     . 
' = ' $start->diff($end)->format('P%dDT%hH%iM%sS') . "\n";
24:
25:
$end   = new DateTime('2010-11-07 01:30:00 EST');
26:
$end->setTimeZone($tz);
27:
$start = new DateTime('2010-11-06 04:30:00');
28: echo 
'bd5 ' $end->format($date_format) . ' - ' $start->format($date_format)
29:     . 
' = ' $start->diff($end)->format($interval_format) . "\n";
30:
31:
$end   = new DateTime('2010-11-07 01:30:00 EDT');
32:
$end->setTimeZone($tz);
33:
$start = new DateTime('2010-11-06 04:30:00');
34: echo 
'bd6 ' $end->format($date_format) . ' - ' $start->format($date_format)
35:     . 
' = ' $start->diff($end)->format($interval_format) . "\n";
36:
37:
$end   = new DateTime('2010-11-07 01:30:00 EST');
38:
$end->setTimeZone($tz);
39:
$start = new DateTime('2010-11-06 01:30:00');
40: echo 
'bd8 ' $end->format($date_format) . ' - ' $start->format($date_format)
41:     . 
' = ' $start->diff($end)->format($interval_format) . "\n";
42:
43: echo 
"\n";
44:
?>
45:

Expected

bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H

Output

bd0 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:59 EDT America/New_York = P1DT0H59M1S
bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H

Diff

001+ bd0 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:59 EDT America/New_York = P1DT0H59M1S
002+ bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
001- bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
002- bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
004+ bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
004- bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H

 

Generated at Mon, 20 Oct 2014 09:57:58 +0000 (2 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.