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