Doc #66899 [Opn->Nab]: Month difference, year difference, etc.
| From: | stas@php.net | Date: | Sun, 08 Jun 2014 23:37:47 +0000 |
| Subject: | Doc #66899 [Opn->Nab]: Month difference, year difference, etc. | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-11269@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66899&edit=1
ID: 66899
Updated by: stas@php.net
Reported by: evazzoler at gmail dot com
Summary: Month difference, year difference, etc.
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Date/time related
Operating System: Any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Can't you just use days property of the interval object?
In any case, this does not look like a fixable bug report, so closing it. If you have a proposal for
a specific fix, please reopen.
Previous Comments:
------------------------------------------------------------------------
[2014-03-13 14:02:29] evazzoler at gmail dot com
Description:
------------
I can't find a detail on how to intend some "quantities".
When I "diff" two dates, and the function returns i.e. "1 month" and "1
day", what does it means with "1 month"?
How many days has one month? Is it a variable quantity depending on the specific month we consider,
or should I assume a "standard"/"normalized"/"conventional" quantity
of 30 days? Is it managed?
A month "concept" in a difference cannot have identity (how can I say we're speaking
about february when I diff two dates?)
So, because I have to calculate it with precision, how do I have to consider "1 month"?
The result could be:
28+1=29 days
29+1=30 days
30+1=31 days
31+1=32 days
3 days of error are not acceptable, I suppose somebody gave to this a sense.
You could suggest to me to use "getTimestamp" but passing trough epoch time causes errors
for dates before 1970 and after 2038...
The same for "year" concept: 365 or 366 days???
This info I'm requesting should be on top of the documentation page!!!!!
Please, fix it!
Test script:
---------------
{just read the doc}
Expected result:
----------------
{just modify the doc}
Actual result:
--------------
{incomplete doc}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66899&edit=1