Doc #66899 [NEW]: Month difference, year difference, etc.
| From: | evazzoler at gmail dot com | Date: | Thu, 13 Mar 2014 14:02:31 +0000 |
| Subject: | Doc #66899 [NEW]: Month difference, year difference, etc. | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-11073@lists.php.net to get a copy of this message | ||
From: evazzoler at gmail dot com
Operating system: Any
PHP version: Irrelevant
Package: *General Issues
Bug Type: Documentation Problem
Bug description:Month difference, year difference, etc.
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 bug report at https://bugs.php.net/bug.php?id=66899&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66899&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66899&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66899&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66899&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66899&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66899&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66899&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66899&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66899&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66899&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66899&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66899&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66899&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66899&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66899&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66899&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66899&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66899&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66899&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66899&r=mysqlcfg