note 126241 added to datetimeimmutable.settimestamp
| From: | Philip at main dot php dot net | Date: | Thu, 15 Jul 2021 11:03:54 +0000 |
| Subject: | note 126241 added to datetimeimmutable.settimestamp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216604@lists.php.net to get a copy of this message | ||
This function will not change the value of the DateTimeImmutable object as the method name might
suggest. The object, after all, immutable.
<?php
$dti = new DateTimeImmutable();
echo $dti->getTimestamp(); // e.g. 123456789
$dti->setTimestamp(987654321);
echo $dti->getTimestamp(); // 123456789
$x = $dti->setTimestamp (987654321);
echo $x->getTimestamp(); // 987654321
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 102.65.211.146)
----
Manual Page -- https://php.net/manual/en/datetimeimmutable.settimestamp.php
Edit -- https://main.php.net/note/edit/126241
Del: integrated -- https://main.php.net/note/delete/126241/integrated
Del: useless -- https://main.php.net/note/delete/126241/useless
Del: bad code -- https://main.php.net/note/delete/126241/bad+code
Del: spam -- https://main.php.net/note/delete/126241/spam
Del: non-english -- https://main.php.net/note/delete/126241/non-english
Del: in docs -- https://main.php.net/note/delete/126241/in+docs
Del: other reasons-- https://main.php.net/note/delete/126241
Reject -- https://main.php.net/note/reject/126241
Search -- https://main.php.net/manage/user-notes.php