PHP  
 PHP_5_4
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-fs.phpt ('RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs)')

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:  * Forward Transitions, sub().
9:  */
10:
11:
$end   = new DateTime('2010-03-14 03:00:00');
12:
$interval_spec 'PT1S';
13:
$interval = new DateInterval($interval_spec);
14: echo 
'fs1 ' $end->format($date_format) . " - $interval_spec = "
15:     
$end->sub($interval)->format($date_format) . "\n";
16:
17:
$end   = new DateTime('2010-03-14 04:30:00');
18:
$interval_spec 'P1D';
19:
$interval = new DateInterval($interval_spec);
20: echo 
'fs2 ' $end->format($date_format) . " - $interval_spec = "
21:     
$end->sub($interval)->format($date_format) . "\n";
22:
23:
$end   = new DateTime('2010-03-14 03:30:00');
24:
$interval_spec 'PT22H';
25:
$interval = new DateInterval($interval_spec);
26: echo 
'fs3 ' $end->format($date_format) . " - $interval_spec = "
27:     
$end->sub($interval)->format($date_format) . "\n";
28:
29:
$end   = new DateTime('2010-03-14 01:30:00');
30:
$interval_spec 'PT21H';
31:
$interval = new DateInterval($interval_spec);
32: echo 
'fs4 ' $end->format($date_format) . " - $interval_spec = "
33:     
$end->sub($interval)->format($date_format) . "\n";
34:
35:
$end   = new DateTime('2010-03-14 01:30:00');
36:
$interval_spec 'P1D';
37:
$interval = new DateInterval($interval_spec);
38: echo 
'fs5 ' $end->format($date_format) . " - $interval_spec = "
39:     
$end->sub($interval)->format($date_format) . "\n";
40:
41:
$end   = new DateTime('2010-03-15 03:30:00');
42:
$interval_spec 'P1D';
43:
$interval = new DateInterval($interval_spec);
44: echo 
'fs6 ' $end->format($date_format) . " - $interval_spec = "
45:     
$end->sub($interval)->format($date_format) . "\n";
46:
47:
$end   = new DateTime('2010-03-15 02:30:00');
48:
$interval_spec 'P1D';
49:
$interval = new DateInterval($interval_spec);
50: echo 
'fs7 ' $end->format($date_format) . " - $interval_spec = "
51:     
$end->sub($interval)->format($date_format) . "\n";
52:
?>
53:

Expected

fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
fs7 2010-03-15 02:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York

Output

fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 03:59:59 EDT America/New_York
fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
fs7 2010-03-15 02:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York

Diff

001+ fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 03:59:59 EDT America/New_York
001- fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York

 

Generated at Thu, 16 Oct 2014 05:27:17 +0000 (6 days ago)

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