note 99387 deleted from datetime.setdate by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 Aug 2010 14:16:38 +0000 |
| Subject: | note 99387 deleted from datetime.setdate by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171676@lists.php.net to get a copy of this message | ||
Note Submitter: giorgio dot liscio at email dot it
----
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