#27327 [Opn->Bgs]: Problem with 2004-03-28 (summer time conversion)
| From: | sniper@php.net | Date: | Fri, 20 Feb 2004 09:16:58 +0000 |
| Subject: | #27327 [Opn->Bgs]: Problem with 2004-03-28 (summer time conversion) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-55223@lists.php.net to get a copy of this message | ||
ID: 27327
Updated by: sniper@php.net
Reported By: timo at reflection-metal dot de
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Suse, RedHat, WinXP, W2K
PHP Version: 4.3.4
New Comment:
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which
do
not suffer from DST.
Previous Comments:
------------------------------------------------------------------------
[2004-02-20 03:41:56] timo at reflection-metal dot de
Just found out that this bug is a problem with summer time conversion.
You could check out e.g. 2003-03-30...
In addition:
If you subtract 1 minute from '2004-03-28 03:00:00' it results in
'2004-03-28 03:59:00'
------------------------------------------------------------------------
[2004-02-20 02:53:44] timo at reflection-metal dot de
Description:
------------
The mktime function gives strange results when adding something that
results between '2004-03-28 01:00:00' and '2004-03-28 01:01:00'.
Reproduce code:
---------------
$STTDate = strToTime('2004-03-28 00:30:00');
$StrangeDate = date('Y-m-d H:i:s',
mktime(date('H',$STTDate),date('i',$STTDate)+30,0,date('m',$STTDate),date('d',$STTDate),date('Y',$STTDate)));
Expected result:
----------------
2004-03-28 01:00:00
Actual result:
--------------
2004-03-28 03:00:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27327&edit=1