note 128371 added to datetimeimmutable.construct
| From: | Dmitrii at main dot php dot net | Date: | Wed, 05 Apr 2023 10:58:44 +0000 |
| Subject: | note 128371 added to datetimeimmutable.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220327@lists.php.net to get a copy of this message | ||
"If $timezone is omitted or null, the current timezone will be used." - note, that
timezone IS NOT equal offset, if its important for your application.
If default timezone = Europe/Moscow, then:
echo (new \DateTimeImmutable('2014-10'))->format(DATE_ATOM); // gives
"2014-10-01T00:00:00+04:00"
echo (new \DateTimeImmutable('2014-11'))->format(DATE_ATOM); // gives
"2014-11-01T00:00:00+03:00"
because of law changes (abolition of "summer time").
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 194.105.130.147)
----
Manual Page -- https://php.net/manual/en/datetimeimmutable.construct.php
Edit -- https://main.php.net/note/edit/128371
Del: integrated -- https://main.php.net/note/delete/128371/integrated
Del: useless -- https://main.php.net/note/delete/128371/useless
Del: bad code -- https://main.php.net/note/delete/128371/bad+code
Del: spam -- https://main.php.net/note/delete/128371/spam
Del: non-english -- https://main.php.net/note/delete/128371/non-english
Del: in docs -- https://main.php.net/note/delete/128371/in+docs
Del: other reasons-- https://main.php.net/note/delete/128371
Reject -- https://main.php.net/note/reject/128371
Search -- https://main.php.net/manage/user-notes.php