note 123427 added to function.date

From: Date: Wed, 12 Dec 2018 18:02:17 +0000
Subject: note 123427 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-209886@lists.php.net to get a copy of this message
Looks like date('u') is not microseconds, but is positive difference from rest part. php > echo (DateTime::createFromFormat('U.u', '-128649659.999998'))->format('Y-m-d H:i:s.u U.u'); 1965-12-03 23:59:01.999998 -128649659.999998 U.u parsed and formatted same, but means not 1965-12-03 23:59:00.000002. Other words correct timestamp for example above is (-128649659 + 0.999998). Less confusing format for it is: php > echo DateTime::createFromFormat('U\+0.u', '-128649660+0.000002')->format('Y-m-d H:i:s.u'); 1965-12-03 23:59:00.000002 Is that bug or feature? ---- Server IP: 208.43.231.9 Probable Submitter: 2a02:6b8:b010:7016::5b (proxied: 37.195.48.10) ---- Manual Page -- http://php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/123427 Del: integrated -- https://master.php.net/note/delete/123427/integrated Del: useless -- https://master.php.net/note/delete/123427/useless Del: bad code -- https://master.php.net/note/delete/123427/bad+code Del: spam -- https://master.php.net/note/delete/123427/spam Del: non-english -- https://master.php.net/note/delete/123427/non-english Del: in docs -- https://master.php.net/note/delete/123427/in+docs Del: other reasons-- https://master.php.net/note/delete/123427 Reject -- https://master.php.net/note/reject/123427 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209886) next »