Doc #68569 [Opn->Fbk]: Datetime microseconds precision loss

From: Date: Tue, 14 Jun 2016 11:09:31 +0000
Subject: Doc #68569 [Opn->Fbk]: Datetime microseconds precision loss
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13507@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68569&edit=1 ID: 68569 Updated by: cmb@php.net Reported by: jenson at axis dot com Summary: Datetime microseconds precision loss -Status: Open +Status: Feedback Type: Documentation Problem Package: Date/time related Operating System: Debian PHP Version: 5.4.35 Block user comment: N Private report: N New Comment: Hm, I can't reproduce this behavior, see <https://3v4l.org/MNSPn>. Do you still face this issue? And I wonder why you have filed this as doc bug. Previous Comments: ------------------------------------------------------------------------ [2014-12-08 15:16:18] jenson at axis dot com Description: ------------ --- From manual page: http://www.php.net/class.datetime --- When creating a DateTime object from ISO string (ie 2014-11-28T12:39:36.257642Z) the microseconds returned by format('u') differ from microseconds in the timestring for certain strings. Test script: --------------- $t = "2014-11-28T12:39:36.257642Z"; $d = new DateTime($t); echo "Input: " . $t . "\n"; echo "Microseconds from datetime: ". $d->format('u'); // ends in 1 Expected result: ---------------- $t = "2014-11-28T12:39:36.257641Z"; $d = new DateTime($t); echo "Input: " . $t . "\n"; echo "Microseconds from datetime: ". $d->format('u'); // Correct ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68569&edit=1

« previous php.doc.bugs (#13507) next »