Bug #67838 [Opn->Dup]: DateTime return with microsecond in default
| From: | requinix@php.net | Date: | Tue, 19 Aug 2014 17:12:53 +0000 |
| Subject: | Bug #67838 [Opn->Dup]: DateTime return with microsecond in default | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187185@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67838&edit=1
ID: 67838
Updated by: requinix@php.net
Reported by: lukyrys at gmail dot com
Summary: DateTime return with microsecond in default
-Status: Open
+Status: Duplicate
Type: Bug
Package: Date/time related
Operating System: Debian 7.5
-PHP Version: 5.5.15
+PHP Version: 5.5.14
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #67838; this came first but the other has been assigned
Previous Comments:
------------------------------------------------------------------------
[2014-08-19 17:12:52] requinix@php.net
Related To: Bug #67838
------------------------------------------------------------------------
[2014-08-14 02:04:43] lukyrys at gmail dot com
Description:
------------
Why microseconds? Is there any option to disable it? Its new at 5.5.14.
# - https://bugs.php.net/bug.php?id=67646
Test script:
---------------
<?php
error_reporting(E_ALL);
$x = new DateTime('now');
$y = new DateTime($x->format('d.m.Y'));
$y->format("Y-m-d H:i:s");
$d = unserialize(serialize($x));
var_dump($d);
var_dump( unserialize(serialize ($y)) );
Expected result:
----------------
object(DateTime)#3 (3) {
["date"]=>
string(26) "2014-07-18 04:20:50"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
object(DateTime)#4 (3) {
["date"]=>
string(26) "2014-07-18 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
Actual result:
--------------
object(DateTime)#3 (3) {
["date"]=>
string(26) "2014-07-18 04:20:50.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
object(DateTime)#4 (3) {
["date"]=>
string(26) "2014-07-18 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67838&edit=1