Doc #76945 [Ver->Csd]: DateTime modify with decimals
| From: | cmb@php.net | Date: | Tue, 02 Oct 2018 15:44:22 +0000 |
| Subject: | Doc #76945 [Ver->Csd]: DateTime modify with decimals | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16043@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76945&edit=1
ID: 76945
Updated by: cmb@php.net
Reported by: wijnand at samson-it dot nl
Summary: DateTime modify with decimals
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Date/time related
PHP Version: 7.2.10
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-10-02 15:43:13] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=345766
Log: Fix #76945: DateTime modify with decimals
------------------------------------------------------------------------
[2018-09-28 15:22:26] wijnand at samson-it dot nl
Ah! Well, I never would have figured that the dot would be interpreted as a delimiter in such a
string.
I'd say that this is confusing enough that it warrants an example in the documentation about
how "+1.5 hours" works, but yields an unexpected result.
------------------------------------------------------------------------
[2018-09-28 15:06:17] salathe@php.net
> Then it's still not correct, because the "+1." part of the string is dropped,
> instead of it saying that this is not recognised.
The "+1" is being interpreted as a timezone correction (see tzcorrection at http://php.net/manual/en/datetime.formats.time.php).
As far as I'm aware, the "." is just being ignored in this case (as would a few other
characters, which I'm not sure we do document well [or at all]).
The intro page for those formats (http://php.net/manual/en/datetime.formats.php) also mentions
"In most cases formats from different sections [of the Supported Date and Time Formats
documentation] can be used in the same date/time string."
Does that help?
------------------------------------------------------------------------
[2018-09-28 13:17:45] wijnand at samson-it dot nl
I suppose you're referring to this:
[+-]?[0-9]+
Then it's still not correct, because the "+1." part of the string is dropped, instead
of it saying that this is not recognised.
------------------------------------------------------------------------
[2018-09-28 12:13:05] salathe@php.net
> It's not documented
The relative date/time statements (and how they behave with non-relative statements) are documented
at http://php.net/manual/en/datetime.formats.relative.php
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=76945
--
Edit this bug report at https://bugs.php.net/bug.php?id=76945&edit=1