ID: 37093 User updated by: robertsaenz at gmail dot com Reported By: robertsaenz at gmail dot com Status: Bogus Bug Type: Date/time related Operating System: Windows XP Professional PHP Version: 5.1.2 New Comment:
I must not be doing something right. I'm trying to do the date.timezone method but for some reason it is not working for me. I'm doing: date.timezone = "US/Mountain" Is there a specific area that it needs to go under php.ini? Or can it just go anywhere in the ini file? I tried it without quotes to no avail. Any help would be great thanks. I'm really trying to avoid having to use the date_default_timezone_set() function. Previous Comments: ------------------------------------------------------------------------ [2006-04-16 08:41:59] [EMAIL PROTECTED] Well, I guess using date.timezone INI setting is even easier. But yes, you can use date_default_timezone_set()/_get() either. ------------------------------------------------------------------------ [2006-04-16 08:36:49] robertsaenz at gmail dot com 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. ------------------------------------------------------------------------ [2006-04-16 08:06:56] [EMAIL PROTECTED] >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