Home » Date and Time » Date » Bug #4878
DATE_FORMAT_ISO_EXTENDED_MICROTIME not padding seconds correctly
Details
| Submitted | 2005-07-22 04:44 UTC |
|---|---|
| From | aashley at optimiser dot com |
| Assigned | pajoye |
| Status | Closed |
| Package | Date |
| PHP Version | 5.0.4 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-07-22 04:44 UTC] aashley at optimiser dot com
Description:
------------
When outputing a date in DATE_FORMAT_ISO_EXTENDED_MICROTIME if seconds < 10 then the seconds are not correctly zero padded.
This means when feeding the output back into a new PEAR Date it is unable to parse the date in correctly.
A patch to fix this is at http://frood.cernun.net/stuff/Date.php-correct-microtime-output.patch
Test script:
---------------
$date = new Date('2005-07-22 12:30:01.000500');
print $date->getDate(DATE_FORMAT_ISO_EXTENDED_MICROTIME);
Expected result:
----------------
2005-07-22T12:21:01.000500
Actual result:
--------------
2005-07-22T12:21:1.000500