#42971 [Opn->Bgs]: DataTime::format(): not well formated data '0000-00-00 00:00:00'
| From: | johannes@php.net | Date: | Tue, 16 Oct 2007 20:43:17 +0000 |
| Subject: | #42971 [Opn->Bgs]: DataTime::format(): not well formated data '0000-00-00 00:00:00' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118604@lists.php.net to get a copy of this message | ||
ID: 42971
Updated by: johannes@php.net
Reported By: tommibi at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux Debian x86_64
PHP Version: 5.2.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2007-10-15 10:41:04] tommibi at gmail dot com
Description:
------------
there is something wrong with date format. I'm using DataTime object in
Propel script and this date ('0000-00-00 00:00:00 ') is given from
database. when i try use it DataTime object it display "-0001-11-30
00:00:00"
Reproduce code:
---------------
<?php
$dt = new DateTime( '0000-00-00 00:00:00' );
var_dump( $dt->format( 'Y-m-d H:i:s' ) );
?>
Expected result:
----------------
string(20) "0000-00-00 00:00:00"
Actual result:
--------------
string(20) "-0001-11-30 00:00:00"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42971&edit=1