#43965 [Opn->Bgs]: get time difference error
| From: | derick@php.net | Date: | Tue, 29 Jan 2008 13:22:15 +0000 |
| Subject: | #43965 [Opn->Bgs]: get time difference error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121730@lists.php.net to get a copy of this message | ||
ID: 43965
Updated by: derick@php.net
Reported By: develop1 at internet-solutions dot ch
-Status: Open
+Status: Bogus
Bug Type: *Calendar problems
Operating System: Windows XP / Linux
PHP Version: 5.2.5
New Comment:
get_time_difference is not an internal function, but it looks like that
function doesn't take into account daylight savings time.
Previous Comments:
------------------------------------------------------------------------
[2008-01-29 12:38:24] develop1 at internet-solutions dot ch
PHP Version 5.2.3
------------------------------------------------------------------------
[2008-01-29 12:36:18] develop1 at internet-solutions dot ch
Description:
------------
$arrivalDate = "2008-03-29";
$departureDate = "2008-04-02";
$diff = get_time_difference($arrivalDate, $departureDate);
echo $diff['days']; (result is: 3)
that's wrong, 'cause it must be 4. (30, 31, 1, 2)
I notice that 31 march 2008 (isn't reconized)
I thought it was caused by 29 february, but in 2004, 2000 and 2012 it's
working fine.
Reproduce code:
---------------
$arrivalDate = "2008-03-29";
$departureDate = "2008-04-02";
$diff = get_time_difference($arrivalDate, $departureDate);
echo $diff['days'];
Expected result:
----------------
$diff => must be 4, and not 3
Actual result:
--------------
3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43965&edit=1