Time zone in date function
| From: | Ron Piggott | Date: | Tue, 31 Jan 2012 01:55:04 +0000 |
| Subject: | Time zone in date function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-316429@lists.php.net to get a copy of this message | ||
On my clients account when I use “echo date(‘D, d M Y H:i:s');” the output is 5 hours
ahead of us. How do I change it to my local time? Is there a way to specify “Eastern” time
zone?
I expect this would work:
echo date(‘D, d M Y H:i:s' , ( strtotime( date(‘D, d M Y H:i:s') – 21600 ) ) );
I would prefer to specify Eastern time, so if the web host changes a server setting it will remain
in Eastern time zone. Ron
Ron Piggott
www.TheVerseOfTheDay.info