note 126673 deleted from class.datetime by cmb
| From: | cmb@php.net | Date: | Fri, 10 Dec 2021 11:40:08 +0000 |
| Subject: | note 126673 deleted from class.datetime by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217352@lists.php.net to get a copy of this message | ||
Note Submitter: Jota
----
if you create a new DateTime from a database with typically Date field, if the default value is
0000-00-00 de real value of the variable don't set to 0000-00-00
Example:
$date = new DateTime ('0000-00-00');
print_r($date);
Result:
DateTime Object
(
[date] => -0001-11-30 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)