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