|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-03-02 00:09 UTC] cmbecker69 at gmx dot de
[2015-03-02 18:46 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2015-03-02 18:46 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 04:00:02 2026 UTC |
Description: ------------ Micro seconds on the date property (and consequently, formatted output) do not update after the initial creation of the DateTime object. Test script: --------------- $datetime = Datetime::createFromFormat('Y-m-d H:i:s.u', '2009-02-09 15:16:17.015750'); $datetime->setTimeStamp(0); print_r($datetime); $datetime = Datetime::createFromFormat('Y-m-d H:i:s', '2009-02-09 15:16:17'); $datetime->setTimeStamp(0.123); print_r($datetime); Expected result: ---------------- DateTime Object ( [date] => 1970-01-01 01:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Berlin ) DateTime Object ( [date] => 1970-01-01 01:00:00.123000 [timezone_type] => 3 [timezone] => Europe/Berlin ) Actual result: -------------- DateTime Object ( [date] => 1970-01-01 01:00:00.015750 [timezone_type] => 3 [timezone] => Europe/Berlin ) DateTime Object ( [date] => 1970-01-01 01:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Berlin )