Bug #55253 [Com]: DateTime::add() and sub() result -1 hour on objects with time zone type 2

2012-09-29 Thread lonnyk at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=55253edit=1

 ID: 55253
 Comment by: lonnyk at gmail dot com
 Reported by:danielc at analysisandsolutions dot com
 Summary:DateTime::add() and sub() result -1 hour on objects
 with time zone type 2
 Status: Closed
 Type:   Bug
 Package:Date/time related
 Operating System:   Ubuntu 10.04
 PHP Version:5.4SVN-2011-07-20 (SVN)
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Just want to put an FYI in this report: It seems as though this fix caused bug 
#62561


Previous Comments:

[2012-07-24 23:38:28] ras...@php.net

Automatic comment on behalf of derick
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=d0a898d2a2852e697ea3d3bde6136993b75ad4f4
Log: - Fixed bug #60236 (TLA timezone dates are not converted properly from   
timestamp). - Fixed bug #55253 (DateTime::add() and sub() result -1 hour on 
objects with   time zone type 2).


[2012-04-18 09:47:21] larue...@php.net

Automatic comment on behalf of derick
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=d0a898d2a2852e697ea3d3bde6136993b75ad4f4
Log: - Fixed bug #60236 (TLA timezone dates are not converted properly from   
timestamp). - Fixed bug #55253 (DateTime::add() and sub() result -1 hour on 
objects with   time zone type 2).


[2011-12-28 01:12:48] dani...@php.net

Automatic comment from SVN on behalf of danielc
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321456
Log: Resolve the last of the xfails from Bug 55253.


[2011-12-27 19:43:48] dani...@php.net

Automatic comment from SVN on behalf of danielc
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321447
Log: Resolve more xfails due to Bug 55253 being fixed.


[2011-12-27 16:57:11] dani...@php.net

Automatic comment from SVN on behalf of danielc
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321442
Log: Resolve some xfails due to Bug 55253 being fixed. (merged from 54)




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=55253


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55253edit=1


Bug #55253 [Com]: DateTime::add() and sub() result -1 hour on objects with time zone type 2

2011-11-20 Thread dani...@php.net
Edit report at https://bugs.php.net/bug.php?id=55253edit=1

 ID: 55253
 Comment by: dani...@php.net
 Reported by:danielc at analysisandsolutions dot com
 Summary:DateTime::add() and sub() result -1 hour on objects
 with time zone type 2
 Status: Open
 Type:   Bug
 Package:Date/time related
 Operating System:   Ubuntu 10.04
 PHP Version:5.4SVN-2011-07-20 (SVN)
 Block user comment: N
 Private report: N

 New Comment:

This is probably related to https://bugs.php.net/bug.php?id=60236


Previous Comments:

[2011-07-20 14:24:08] dani...@php.net

Automatic comment from SVN on behalf of danielc
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=313484
Log: Rename and enhance test for bug 55253 now that bugs web is up.


[2011-07-20 14:18:36] danielc at analysisandsolutions dot com

Description:

Calling add() or sub() on DateTime objects using a type 2 time zone results in 
the answer being behind by one hour.

Test script has been added to SVN.

Test script:
---
date_default_timezone_set('America/New_York');

$interval = new DateInterval('PT2H1M');

$date3 = new DateTime('2010-10-04 02:18:48');
$date2 = new DateTime('2010-10-04 02:18:48 EDT');

echo 'Zone Type 3: ' . $date3-format('Y-m-d H:i:s T') . \n;
echo 'Zone Type 2: ' . $date2-format('Y-m-d H:i:s T') . \n;

echo $interval-format('Add %h hours %i minutes') . \n;
$date3-add($interval);
$date2-add($interval);

echo 'Zone Type 3: ' . $date3-format('Y-m-d H:i:s T') . \n;
echo 'Zone Type 2: ' . $date2-format('Y-m-d H:i:s T') . \n;

// Try subtracting from expected result.
$date3 = new DateTime('2010-10-04 04:19:48');
$date2 = new DateTime('2010-10-04 04:19:48 EDT');

echo $interval-format('Subtract %h hours %i minutes from expected') . \n;
$date3-sub($interval);
$date2-sub($interval);

echo 'Zone Type 3: ' . $date3-format('Y-m-d H:i:s T') . \n;
echo 'Zone Type 2: ' . $date2-format('Y-m-d H:i:s T') . \n;


Expected result:

Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 02:18:48 EDT
Add 2 hours 1 minutes
Zone Type 3: 2010-10-04 04:19:48 EDT
Zone Type 2: 2010-10-04 04:19:48 EDT
Subtract 2 hours 1 minutes from expected
Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 02:18:48 EDT


Actual result:
--
Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 02:18:48 EDT
Add 2 hours 1 minutes
Zone Type 3: 2010-10-04 04:19:48 EDT
Zone Type 2: 2010-10-04 03:19:48 EDT
Subtract 2 hours 1 minutes from expected
Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 01:18:48 EDT







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55253edit=1


Bug #55253 [Com]: DateTime::add() and sub() result -1 hour on objects with time zone type 2

2011-08-29 Thread Jamesjerseys at 126 dot com
Edit report at https://bugs.php.net/bug.php?id=55253edit=1

 ID: 55253
 Comment by: Jamesjerseys at 126 dot com
 Reported by:danielc at analysisandsolutions dot com
 Summary:DateTime::add() and sub() result -1 hour on objects
 with time zone type 2
 Status: Open
 Type:   Bug
 Package:Date/time related
 Operating System:   Ubuntu 10.04
 PHP Version:5.4SVN-2011-07-20 (SVN)
 Block user comment: N
 Private report: N

 New Comment:

http://www.shopnflapparel.com/kevin-boss-jersey-c-184_245_1386.html Kevin 
Boss Jersey


Previous Comments:

[2011-07-20 14:24:08] dani...@php.net

Automatic comment from SVN on behalf of danielc
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=313484
Log: Rename and enhance test for bug 55253 now that bugs web is up.


[2011-07-20 14:18:36] danielc at analysisandsolutions dot com

Description:

Calling add() or sub() on DateTime objects using a type 2 time zone results in 
the answer being behind by one hour.

Test script has been added to SVN.

Test script:
---
date_default_timezone_set('America/New_York');

$interval = new DateInterval('PT2H1M');

$date3 = new DateTime('2010-10-04 02:18:48');
$date2 = new DateTime('2010-10-04 02:18:48 EDT');

echo 'Zone Type 3: ' . $date3-format('Y-m-d H:i:s T') . \n;
echo 'Zone Type 2: ' . $date2-format('Y-m-d H:i:s T') . \n;

echo $interval-format('Add %h hours %i minutes') . \n;
$date3-add($interval);
$date2-add($interval);

echo 'Zone Type 3: ' . $date3-format('Y-m-d H:i:s T') . \n;
echo 'Zone Type 2: ' . $date2-format('Y-m-d H:i:s T') . \n;

// Try subtracting from expected result.
$date3 = new DateTime('2010-10-04 04:19:48');
$date2 = new DateTime('2010-10-04 04:19:48 EDT');

echo $interval-format('Subtract %h hours %i minutes from expected') . \n;
$date3-sub($interval);
$date2-sub($interval);

echo 'Zone Type 3: ' . $date3-format('Y-m-d H:i:s T') . \n;
echo 'Zone Type 2: ' . $date2-format('Y-m-d H:i:s T') . \n;


Expected result:

Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 02:18:48 EDT
Add 2 hours 1 minutes
Zone Type 3: 2010-10-04 04:19:48 EDT
Zone Type 2: 2010-10-04 04:19:48 EDT
Subtract 2 hours 1 minutes from expected
Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 02:18:48 EDT


Actual result:
--
Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 02:18:48 EDT
Add 2 hours 1 minutes
Zone Type 3: 2010-10-04 04:19:48 EDT
Zone Type 2: 2010-10-04 03:19:48 EDT
Subtract 2 hours 1 minutes from expected
Zone Type 3: 2010-10-04 02:18:48 EDT
Zone Type 2: 2010-10-04 01:18:48 EDT







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55253edit=1