Welcome to WebmasterWorld Guest from 54.166.102.61

Forum Moderators: coopster & jatar k

Telling the time in PHP

adjusting for different time zones

   
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");
?>
4:04 pm on Aug 5, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 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.

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

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

Nick

 

Featured Threads

Hot Threads This Week

Hot Threads This Month