cancer10
01-11-2010, 05:12 AM
Hello
I was wondering what setting I have to put in my PHP script so that I can get my timezone set to Atlanta (http://www.timeanddate.com/worldclock/city.html?n=25)
I dont seem to find it on the php.net site (http://www.php.net/manual/en/timezones.america.php)
Thanks
use a "major city" like
<?php
date_default_timezone_set('America/New_York');
echo date('D,F j, Y, h:i:s A');
?>
or even try
<?php
date_default_timezone_set('America/Atlanta');
echo date('D,F j, Y, h:i:s A');
?>
cant tell you if it works with atlanta but its worth a shot
cancer10
01-11-2010, 07:21 AM
hey America/New_York worked, thanks :)
cancer10
01-11-2010, 07:42 AM
Question:
It works fine on my localhost but when I upload the same code, it shows me a time which is off by 1 hour.
Any idea whats happening?
oracleguy
01-11-2010, 07:55 AM
Maybe it isn't accounting for daylight savings properly?
cancer10
01-11-2010, 12:48 PM
Assuming that is the case, How do fix it then?
cancer10
01-19-2010, 05:40 AM
Any update on this will be appreciated :thumbsup:
cancer10
01-27-2010, 05:28 AM
Question: How do I maintain daylight savings using php?
Len Whistler
01-27-2010, 05:36 AM
Question: How do I maintain daylight savings using php?
I don't know much about the php time zone function but I assume you would have to create an if statement. If the current date is between the dates that daylight savings is in affect then you add the hour, or subtract.
------
cancer10
01-27-2010, 06:13 AM
I don't know much about the php time zone function but I assume you would have to create an if statement. If the current date is between the dates that daylight savings is in affect then you add the hour, or subtract.
------
Hi
I dont want to sound like a nerd but can you please tell me what is a "daylight saving"?
Len Whistler
01-27-2010, 06:19 AM
Hi
I dont want to sound like a nerd but can you please tell me what is a "daylight saving"?
That's when the clocks are moved forward - or backward - one hour to give us extra sunlight during the winter. I think it's from October to April. Some Countries don't bother with it.
----