ID:               29502
 User updated by:  ticoroman at msn dot com
 Reported By:      ticoroman at msn dot com
 Status:           Open
 Bug Type:         Date/time related
 Operating System: Windows XP
 PHP Version:      Irrelevant
 New Comment:

This was confusing. By applying the 7th argument to gmmktime() I got it
working like it should [at least it seems like that now]!

Even though I litterally RTFM from the start to the end I unfortunately
never noticed the 7th argument. I deeply apologize as the whole thing
turned out to be bogus. :(

Greetings,
Tico


Previous Comments:
------------------------------------------------------------------------

[2004-08-03 08:05:53] ticoroman at msn dot com

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 this bug report at http://bugs.php.net/?id=29502&edit=1

Reply via email to