|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-03 09:11 UTC] ticoroman at msn dot com
[2004-08-03 09:22 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 08:00:01 2025 UTC |
Description: ------------ I'm trying to use gmmktime() to convert a string (from database) containing date and time to managable date. When the time (in the string) is 02:00:00 28 mars 2004 it's getting strange! The error only occurs when the hour is 2, which is exactly when Daylight Saving Time should start in UTC+0100. When using 01:00:00 and 03:00:00 it works just fine. I consider this a bug, cause it make no sense. Shortly: The date from the database is saved in GMT-time and I want to KEEP IT that way. The reason I have to use gmmktime() is because of further necessary adjustments of the date! Reproduce code: --------------- <?php echo "<br>1. "; echo gmdate("Y-m-d H:i:s", gmmktime(02, 0, 0, 3, 27, 2004)); echo "<br>2. "; echo gmdate("Y-m-d H:i:s", gmmktime(02, 0, 0, 3, 28, 2004)); echo "<br>3. "; echo gmdate("Y-m-d H:i:s", gmmktime(02, 0, 0, 3, 29, 2004)); echo "<br>"; ?> Expected result: ---------------- 1. 2004-03-27 02:00:00 2. 2004-03-28 02:00:00 3. 2004-03-29 02:00:00 Actual result: -------------- 1. 2004-03-27 02:00:00 2. 2004-03-28 01:00:00 3. 2004-03-29 02:00:00