note 127599 added to datetime.construct
| From: | jeroen.alisqi.com via php-notes | Date: | Wed, 07 Sep 2022 12:09:37 +0000 |
| Subject: | note 127599 added to datetime.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219542@lists.php.net to get a copy of this message | ||
Be aware that the constructor will not not throw or even raise a warning if the year is over 4
digits. Instead, the datetime will be a seemingly random value.
<?php
$dt = new DateTime('10000-01-01');
$dt->format('Y-m-d H:i:s'); // "2000-01-01 10:00:00"
?>
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.173 (proxied: 2a10:3781:12b3:1:f82e:4a1f:942b:7697)
----
Manual Page -- https://php.net/manual/en/datetime.construct.php
Edit -- https://main.php.net/note/edit/127599
Del: integrated -- https://main.php.net/note/delete/127599/integrated
Del: useless -- https://main.php.net/note/delete/127599/useless
Del: bad code -- https://main.php.net/note/delete/127599/bad+code
Del: spam -- https://main.php.net/note/delete/127599/spam
Del: non-english -- https://main.php.net/note/delete/127599/non-english
Del: in docs -- https://main.php.net/note/delete/127599/in+docs
Del: other reasons-- https://main.php.net/note/delete/127599
Reject -- https://main.php.net/note/reject/127599
Search -- https://main.php.net/manage/user-notes.php