|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-03-17 07:35 UTC] dawid dot lakomski at gmail dot com
Description:
------------
After upgrading to PHP 7.1.3 I noticed that microseconds are now missing from DateTime objects.
Test script:
---------------
<?php
var_dump(new \DateTime());
Expected result:
----------------
Microseconds part of $date field should not be 000000 (or not always ;) )
Actual result:
--------------
class DateTime#1 (3) {
public $date =>
string(26) "2017-03-17 08:25:48.000000"
public $timezone_type =>
int(3)
public $timezone =>
string(13) "Europe/Berlin"
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 10:00:01 2025 UTC |
I have the same issue inside official Docker image. Test script: ------------ <?php echo (new DateTimeImmutable('now'))->format('H:i:s.u'); Results: -------- PHP 7.0.17: 15:53:06.000000 PHP 7.1.0: 15:53:26.871760 PHP 7.1.1: 15:53:38.272202 PHP 7.1.2: 15:53:48.824298 PHP 7.1.3: 15:54:03.000000 I've tested multiple times every version.