|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-02-20 02:53 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 14:00:02 2025 UTC |
Just tested to switch the timezone to GMT (former CET), alas same result. Also echo gmdate('Y-m-d H:i:s', gmmktime(0, 59+1, 0, 03, 28, 2004)); is giving '2004-03-28 03:00:00'. Reproduced this on 6 PCs and also in PHP 4.3.3. Unfortunately I cannot try the latest snapshot, 'cause all machines are production servers. Maybe I could get some time to setup a new one during this week. Maybe it's nothing but a guess but: Daylight saving time outside europe starts at 01:00:00 ('cause CET is GMT+1) and inside europe 02:00:00. Could it be that they are used BOTH?