Req #49914 [Com]: DateInterval doesn't implement comparison functions
| From: | photon0 at gmail dot com | Date: | Fri, 04 Jan 2019 16:15:33 +0000 |
| Subject: | Req #49914 [Com]: DateInterval doesn't implement comparison functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218794@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=49914&edit=1
ID: 49914
Comment by: photon0 at gmail dot com
Reported by: aharvey@php.net
Summary: DateInterval doesn't implement comparison functions
Status: No Feedback
Type: Feature/Change Request
Package: Date/time related
Operating System: *
PHP Version: 5.3SVN-2009-10-18 (SVN)
Block user comment: N
Private report: N
New Comment:
@heiglandreas
I would argue that the simplest way to compare these objects (since there is no real accurate way to
do so) is to compare two DateTime starting at Unix epoch and each offset by ->add(DateInterval).
I don't think this request is sugar coating.
Previous Comments:
------------------------------------------------------------------------
[2017-04-02 04:22:27] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2017-03-24 06:37:06] requinix@php.net
Related To: Bug #70381
------------------------------------------------------------------------
[2017-03-24 06:28:53] heiglandreas@php.net
Just one small question to those that commented here: How would you compare those two intervals: P1M
and P30D - which one is the greater one? is it P1M even though I'm currently in february? Or is
it P30D even though I'm currently in August? What about PT24H30M and P1D? Under certain
circumstances a Day can have more or less that 24 hours (DST-transition)
Even though those might be edge-cases exactly those edge-cases need to be handled or they will show
up here in the bug-tracker.
So I'd really like to get some feedback on how you think those edge-cases should be handled.
Otehrwise there are some userland libraries that handle most aspects of Interval-COmparison but not
those edge-cases⦠(f.e but not limited to https://packagist.org/packages/org_heigl/dateintervalcomparator)
------------------------------------------------------------------------
[2015-12-03 14:28:09] will dot tinsdeall at mercianlabels dot com
Any closer to applying a fix on this? It's a real shame it didn't make it into 7.0
------------------------------------------------------------------------
[2015-05-24 15:44:46] cmb@php.net
Related To: Bug #68187
------------------------------------------------------------------------
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=49914
--
Edit this bug report at https://bugs.php.net/bug.php?id=49914&edit=1