note 99388 added to datetime.settime
| From: | giorgio dot liscio at email dot it | Date: | Sat, 14 Aug 2010 05:25:43 +0000 |
| Subject: | note 99388 added to datetime.settime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171670@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.settime.php
Edit -- https://master.php.net/note/edit/99388
Del: integrated -- https://master.php.net/note/delete/99388/integrated
Del: useless -- https://master.php.net/note/delete/99388/useless
Del: bad code -- https://master.php.net/note/delete/99388/bad+code
Del: spam -- https://master.php.net/note/delete/99388/spam
Del: non-english -- https://master.php.net/note/delete/99388/non-english
Del: in docs -- https://master.php.net/note/delete/99388/in+docs
Del: other reasons-- https://master.php.net/note/delete/99388
Reject -- https://master.php.net/note/reject/99388
Search -- https://master.php.net/manage/user-notes.php