php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66899 Month difference, year difference, etc.
Submitted: 2014-03-13 14:02 UTC Modified: 2014-06-08 23:37 UTC
From: evazzoler at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: evazzoler at gmail dot com
New email:
PHP Version: OS:

 

 [2014-03-13 14:02 UTC] 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}

Patches

Patch668899 (last revision 2014-03-13 14:03 UTC by evazzoler at gmail dot com)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-20 22:08 UTC] stas@php.net
-Package: *General Issues +Package: Date/time related
 [2014-06-08 23:37 UTC] stas@php.net
-Status: Open +Status: Not a bug
 [2014-06-08 23:37 UTC] stas@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 16:01:29 2024 UTC