Home » Date and Time » Date » Bug #7689
Incorrect conversion of timezone offsets to unix timestamps
Details
| Submitted | 2006-05-22 09:52 UTC |
|---|---|
| From | matt at zgroupplc dot com |
| Status | No Feedback |
| Package | Date |
| PHP Version | 5.0.5 |
| OS | OS X 10.4.6 |
| Roadmaps | (Not assigned) |
Comments
[2006-05-22 09:52 UTC] matt at zgroupplc dot com
Description:
------------
When passing '1970-01-01T00:00:00.000+01:00' to the Date class constructor, it interprets the unix timestamp as -7200. This should be -3600. The built in php function strtotime correctly returns -3600.
Test script:
---------------
require_once 'Date.php';
$date = '1970-01-01T00:00:00.000+01:00';
var_dump(strtotime($date));
$date = new Date($date);
var_dump($date->getTime());
Expected result:
----------------
int(-3600)
int(-3600)
Actual result:
--------------
int(-3600)
int(-7200)