note 99386 added to datetime.settimezone
| From: | giorgio dot liscio at email dot it | Date: | Sat, 14 Aug 2010 05:24:06 +0000 |
| Subject: | note 99386 added to datetime.settimezone | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171668@lists.php.net to get a copy of this message | ||
please note that using
setTimezone
setTimestamp
setDate
setTime
etc..
will modify the original object, and the return value is $this
$original = new DateTime("now");
$modified = $original->setTimezone(new DateTimezone("europe/rome"));
echo $original === $modified ? "THE OBJECT IS THE SAME" : "OBJECTS ARE
DIFFERENT";
so a datetime object is mutable
----
Server IP: 69.147.83.197
Probable Submitter: 87.7.137.17
----
Manual Page -- http://www.php.net/manual/en/datetime.settimezone.php
Edit -- https://master.php.net/note/edit/99386
Del: integrated -- https://master.php.net/note/delete/99386/integrated
Del: useless -- https://master.php.net/note/delete/99386/useless
Del: bad code -- https://master.php.net/note/delete/99386/bad+code
Del: spam -- https://master.php.net/note/delete/99386/spam
Del: non-english -- https://master.php.net/note/delete/99386/non-english
Del: in docs -- https://master.php.net/note/delete/99386/in+docs
Del: other reasons-- https://master.php.net/note/delete/99386
Reject -- https://master.php.net/note/reject/99386
Search -- https://master.php.net/manage/user-notes.php