|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-10-07 17:44 UTC] derick@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: derick
[2016-10-07 17:44 UTC] derick@php.net
[2016-10-07 17:49 UTC] derick@php.net
[2016-10-17 10:07 UTC] bwoebi@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ From what I can find it's currently not possible to add or subtract microseconds using DateTime::format. Every other unit of time can be added or subtracted. Please consider adding: decisecond centisecond millisecond microsecond Test script: --------------- $time = new DateTime('01:01:01.000001'); $timeH = $time->modify('+1 hour'); echo $timeH->format('H:i:s.u') . '<br>'; // prints 02:01:01.000001 $timeM = $time->modify('+1 minute'); echo $timeM->format('H:i:s.u') . '<br>'; // prints 02:02:01.000001 $timeS = $time->modify('+1 second'); echo $timeS->format('H:i:s.u') . '<br>'; // prints 02:02:02.000001 $timeMS = $time->modify('+1 microsecond'); echo $timeMS->format('H:i:S:u') . '<br>'; // error