Forum Moderators: coopster

Message Too Old, No Replies

Telling the time in PHP

adjusting for different time zones

         

dvduval

12:51 pm on Aug 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I now have my site telling the time, but the only problem is that it is in GMT and I need Eastern Standard Time. Can someone help me adjust my time? (I'm pretty new at this)
Current script looks like this:
<?php echo gmdate("M d Y");
?>

jatar_k

4:04 pm on Aug 5, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The first question is are you actually in EST, if you are you can just use date() instead of gmdate().

You can look at the date function [php.net]

If you are not in EST then you will have to convert and this may take a little more work.

Nick_W

4:08 pm on Aug 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also check out the set_locale() function in the manual, I think you can do what you need with that...

Nick