#37093 [Opn->Fbk]: Daylight Savings Time error

From: Date: Sun, 16 Apr 2006 08:06:56 +0000
Subject: #37093 [Opn->Fbk]: Daylight Savings Time error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95854@lists.php.net to get a copy of this message
ID: 37093 Updated by: tony2001@php.net Reported By: robertsaenz at gmail dot com -Status: Open +Status: Feedback Bug Type: Date/time related Operating System: Windows XP Professional PHP Version: 5.1.2 New Comment: >The timezone is: MST and I am in DST territory. Which means it's actually MDT, not MST. What if you set the correct timezone with date_default_timezone_set() ? Previous Comments: ------------------------------------------------------------------------ [2006-04-15 23:28:04] robertsaenz at gmail dot com Description: ------------ The time returned from the date() function is incorrect. The time is an hour behind what it actually should be. This occured after the clocks were set forward an hour. The timezone is: MST and I am in DST territory. The code should explain my problem better. My server is set to use DST and now since our clocks have been set forward (as mentioned before) I've been getting that hour time difference. My work around for now is to set the server's clock an hour ahead which outputs the expected result, however this is not what I want to do. Is there maybe a work around for this. I searched the bugs but didn't find anything that lead to the exact problem I had, but if there is a duplicate I apologize and if you can point me to it that would be great. Thanks. Reproduce code: --------------- <?php echo date("Y-m-d H:i:s T I"); ?> Expected result: ---------------- 2006-04-15 17:19:55 MST 0 Actual result: -------------- 2006-04-15 16:19:55 MST 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37093&edit=1

« previous php.bugs (#95854) next »