Bug #60089 [NEW]: DateTime::createFromFormat() U after u nukes microtime
| From: | salathe@php.net | Date: | Tue, 18 Oct 2011 21:03:33 +0000 |
| Subject: | Bug #60089 [NEW]: DateTime::createFromFormat() U after u nukes microtime | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-164414@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: trunk-SVN-2011-10-18 (SVN)
Package: Date/time related
Bug Type: Bug
Bug description:DateTime::createFromFormat() U after u nukes microtime
Description:
------------
A format string containing a Unix timestamp at any point after a
microsecond value
leaves the microseconds unset in the resulting DateTime object.
Test script:
---------------
<?php
date_default_timezone_set('UTC');
var_dump(DateTime::createFromFormat('u U', '123456
123456790')->format('U
u'));
?>
Expected result:
----------------
string(16) "123456790 123456"
Actual result:
--------------
string(16) "123456790 000000"
--
Edit bug report at https://bugs.php.net/bug.php?id=60089&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60089&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60089&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60089&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60089&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60089&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60089&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60089&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60089&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60089&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60089&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60089&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60089&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60089&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60089&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60089&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60089&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60089&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60089&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60089&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60089&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60089&r=mysqlcfg