note 129353 added to function.strtotime
| From: | et.coder@gmail.com | Date: | Mon, 25 Mar 2024 09:25:27 +0000 |
| Subject: | note 129353 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221257@lists.php.net to get a copy of this message | ||
> The Unix timestamp that this function returns does not contain information about time zones. In
> order to do calculations with date/time information, you should use the more capable
> DateTimeImmutable.
important - does not contain
<?php
date_default_timezone_set('Europe/Berlin');
// .... a lot of code
echo $a = strtotime('yesterday 00:00');
// in $a hour = 23:00:00 and you may not know about it
// https://onlinephp.io/c/ef696
// use DateTimeImmutable
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 178.126.254.206)
----
Manual Page -- https://php.net/manual/en/function.strtotime.php
Edit -- https://main.php.net/note/edit/129353
Del: integrated -- https://main.php.net/note/delete/129353/integrated
Del: useless -- https://main.php.net/note/delete/129353/useless
Del: bad code -- https://main.php.net/note/delete/129353/bad+code
Del: spam -- https://main.php.net/note/delete/129353/spam
Del: non-english -- https://main.php.net/note/delete/129353/non-english
Del: in docs -- https://main.php.net/note/delete/129353/in+docs
Del: other reasons-- https://main.php.net/note/delete/129353
Reject -- https://main.php.net/note/reject/129353
Search -- https://main.php.net/manage/user-notes.php