From: knut dot urdalen at gmail dot com Operating system: Mac OS X 10.5.6 PHP version: 5.2.9 PHP Bug Type: Date/time related Bug description: Microseconds output in DateTime::format()
Description: ------------ The date()-function allow a 'u' format character in the formatting field as of PHP 5.2.2. The DateTime::format() function point to the same manual page for the formatting as the date() function and since DateTime actually store microseconds internally (as mentioned by Derick previously) I think it's a bug that it's not output correctly. Reproduce code: --------------- <?php date_default_timezone_set('Europe/Oslo'); $datetime = new DateTime(); echo $datetime->format('Y-m-d H:i:s.u')."\n"; ?> Expected result: ---------------- The 'u' format character should output the microsecond that is internally stored in the DateTime object upon creation. Actual result: -------------- The 'u' format character always resolve to 00000. -- Edit bug report at http://bugs.php.net/?id=48225&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48225&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48225&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48225&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48225&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48225&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48225&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48225&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48225&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48225&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48225&r=support Expected behavior: http://bugs.php.net/fix.php?id=48225&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48225&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48225&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48225&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48225&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48225&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48225&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48225&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48225&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48225&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48225&r=mysqlcfg