note 128319 added to function.strtotime
| From: | VyacheslavBelchuk at main dot php dot net | Date: | Fri, 17 Mar 2023 15:39:01 +0000 |
| Subject: | note 128319 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220276@lists.php.net to get a copy of this message | ||
Be careful when using two numbers as the year. I came across this situation:
<?php
echo strtotime('24.11.22');
echo date('d.m.Y H:i:s', 1669324282) . "\n\n";
// But
echo strtotime('24.11.2022');
echo date('d.m.Y H:i:s', 1669237200);
?>
Output:
1669324282
25.11.2022 00:11:22
1669237200
24.11.2022 00:00:00
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 116.203.18.87)
----
Manual Page -- https://php.net/manual/en/function.strtotime.php
Edit -- https://main.php.net/note/edit/128319
Del: integrated -- https://main.php.net/note/delete/128319/integrated
Del: useless -- https://main.php.net/note/delete/128319/useless
Del: bad code -- https://main.php.net/note/delete/128319/bad+code
Del: spam -- https://main.php.net/note/delete/128319/spam
Del: non-english -- https://main.php.net/note/delete/128319/non-english
Del: in docs -- https://main.php.net/note/delete/128319/in+docs
Del: other reasons-- https://main.php.net/note/delete/128319
Reject -- https://main.php.net/note/reject/128319
Search -- https://main.php.net/manage/user-notes.php