note 128226 added to datetime.createfromformat
| From: | Uplink at main dot php dot net | Date: | Fri, 17 Feb 2023 12:26:06 +0000 |
| Subject: | note 128226 added to datetime.createfromformat | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220182@lists.php.net to get a copy of this message | ||
WARNING of subtle bug / feature:
createDateFromFormat (with format 'Y-m-d' for this example) will happily accept
'2022-02-29' (February 29 in a non-leap year) and turn it into '2022-03-01' with
no warnings, possibly creating weird bugs in your application.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 2a02:6b65:10eb:0:5c10:4c4e:1ca6:d154)
----
Manual Page -- https://php.net/manual/en/datetime.createfromformat.php
Edit -- https://main.php.net/note/edit/128226
Del: integrated -- https://main.php.net/note/delete/128226/integrated
Del: useless -- https://main.php.net/note/delete/128226/useless
Del: bad code -- https://main.php.net/note/delete/128226/bad+code
Del: spam -- https://main.php.net/note/delete/128226/spam
Del: non-english -- https://main.php.net/note/delete/128226/non-english
Del: in docs -- https://main.php.net/note/delete/128226/in+docs
Del: other reasons-- https://main.php.net/note/delete/128226
Reject -- https://main.php.net/note/reject/128226
Search -- https://main.php.net/manage/user-notes.php