Bug #10217 Updated: Feature
| From: | cnewbill@php.net | Date: | Sun, 17 Mar 2002 19:33:02 +0000 |
| Subject: | Bug #10217 Updated: Feature | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-2705@lists.php.net to get a copy of this message | ||
ID: 10217
Updated by: cnewbill@php.net
Reported By: karl@sukz.org
-Status: Closed
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: linux 2.2.16
PHP Version: 4.0.4pl1
Assigned To: shiflett
New Comment:
PEAR is somewhat nice and all, but this should really be CORE
functionality. What if they don't have PEAR and they're not allowed to
install it or don't know how or don't even know it's there or....?
*Most* Functions in the Date/Time category should be core IMO since we
already give them plenty of rope to hang themselves with other date
manipulation functions. This function is one that should be in
core...I'm sure you'll dislike this example, but developers coming from
VBScript
will expect an equivalent to DateDiff().
We already have functions that *could* be done easily in userland as
well...array_diff() is one of them. So I don't buy that argument, nor
the bloat argument as this should be a small addition.
Would like some feedback for and against this addition.
-Chris
Previous Comments:
------------------------------------------------------------------------
[2002-03-17 13:37:05] shiflett@php.net
I suppose it does. I should familiarize myself with PEAR more before I
accidentally reinvent the wheel.
------------------------------------------------------------------------
[2002-02-10 05:25:32] sander@php.net
Doesn't PEAR have a class which does that?
------------------------------------------------------------------------
[2002-02-10 00:37:57] shiflett@php.net
Actually, I think Karl has a good suggestion, and the - operator wasn't
the answer he was looking for.
Try to calculate how many seconds, minutes, hours, days, weeks, and
years between two random times, and I bet it takes you several lines of
PHP. Just because it *can* be done now doesn't mean it isn't worth
considering making a function to help make it easier for people.
Is there a good reason why we shouldn't add some helpful date/time
functions? If not, I'll be happy to take on the project myself.
------------------------------------------------------------------------
[2002-02-09 23:32:35] jimw@php.net
it's called the - operator.
------------------------------------------------------------------------
[2001-04-06 19:39:54] karl@sukz.org
I noticed there is no function in php to tell the duration between two
times, unless of course there is and i just didn't see it. I was
wondering if you could impliment one in the next version.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10217&edit=1