note 124523 added to class.dateinterval
| From: | Anonymous@php.net | Date: | Thu, 19 Dec 2019 14:54:32 +0000 |
| Subject: | note 124523 added to class.dateinterval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213556@lists.php.net to get a copy of this message | ||
//create a date
$now = new \DateTime();
//create a specific date
$someDate = \DateTime::createFromFormat("Y-m-d H:i", "2019-12-19 15:27")
//Add one day
$someDate->add(new DateInterval("P1D"));
//convert to string
echo $someDate->format("Y-m-d"); //2019-12-20
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.195 (proxied: 51.9.182.95)
----
Manual Page -- http://php.net/manual/en/class.dateinterval.php
Edit -- https://master.php.net/note/edit/124523
Del: integrated -- https://master.php.net/note/delete/124523/integrated
Del: useless -- https://master.php.net/note/delete/124523/useless
Del: bad code -- https://master.php.net/note/delete/124523/bad+code
Del: spam -- https://master.php.net/note/delete/124523/spam
Del: non-english -- https://master.php.net/note/delete/124523/non-english
Del: in docs -- https://master.php.net/note/delete/124523/in+docs
Del: other reasons-- https://master.php.net/note/delete/124523
Reject -- https://master.php.net/note/reject/124523
Search -- https://master.php.net/manage/user-notes.php