ID: 48225 Updated by: j...@php.net Reported By: knut dot urdalen at gmail dot com -Status: Open +Status: Verified Bug Type: Date/time related -Operating System: Mac OS X 10.5.6 +Operating System: * -PHP Version: 5.2.9 +PHP Version: 5.*, 6CVS (2009-05-09)
Previous Comments: ------------------------------------------------------------------------ [2009-05-10 17:29:54] knut dot urdalen at gmail dot com 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 this bug report at http://bugs.php.net/?id=48225&edit=1