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

From: Date: Sun, 16 Apr 2006 08:36:49 +0000
Subject: #37093 [Fbk->Opn]: Daylight Savings Time error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95855@lists.php.net to get a copy of this message
ID: 37093 User updated by: robertsaenz at gmail dot com Reported By: robertsaenz at gmail dot com -Status: Feedback +Status: Open Bug Type: Date/time related Operating System: Windows XP Professional PHP Version: 5.1.2 New Comment: Oops! Sorry meant to say MDT and I should have expected MDT but I didn't put that down, nor did I put a 1 expected for DST in expected result. Yeah using date_default_timezone_set() worked. Is there a way to change this permanently or do I have to do this for every script that uses the date function? Thanks. Previous Comments: ------------------------------------------------------------------------ [2006-04-16 08:06:56] tony2001@php.net >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() ? ------------------------------------------------------------------------ [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 (#95855) next »