note 127135 added to dateinterval.createfromdatestring
| From: | BobRay at main dot php dot net | Date: | Thu, 26 May 2022 05:10:19 +0000 |
| Subject: | note 127135 added to dateinterval.createfromdatestring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-218528@lists.php.net to get a copy of this message | ||
Weeks are always converted to days and added to any days specified. As far as I can tell, this is
the only calculation done by the method. Somewhat surprisingly, this works (though obviously it
would be a poor coding practice):
$di = DateInterval::createFromDateString('62 weeks + 1 day + 2 weeks + 2 hours + 70
minutes');
/* Stored as 0 years, 449 days, 2 hours, 70 minutes */
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.12.131 (proxied: 2601:448:4200:1e7a:8045:2620:37df:daa0)
----
Manual Page -- https://php.net/manual/en/dateinterval.createfromdatestring.php
Edit -- https://main.php.net/note/edit/127135
Del: integrated -- https://main.php.net/note/delete/127135/integrated
Del: useless -- https://main.php.net/note/delete/127135/useless
Del: bad code -- https://main.php.net/note/delete/127135/bad+code
Del: spam -- https://main.php.net/note/delete/127135/spam
Del: non-english -- https://main.php.net/note/delete/127135/non-english
Del: in docs -- https://main.php.net/note/delete/127135/in+docs
Del: other reasons-- https://main.php.net/note/delete/127135
Reject -- https://main.php.net/note/reject/127135
Search -- https://main.php.net/manage/user-notes.php