From:             ticoroman at msn dot com
Operating system: Windows XP
PHP version:      Irrelevant
PHP Bug Type:     Date/time related
Bug description:  gmmiketime() does not behave like GMT

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

-- 
Edit bug report at http://bugs.php.net/?id=29502&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29502&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29502&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29502&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29502&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29502&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29502&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29502&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29502&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29502&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29502&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29502&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29502&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29502&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29502&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29502&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29502&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29502&r=float

Reply via email to