Time zones and PHP question ...
July 27, 2009 7:05 AM
Subscribe
PHP gurus: please help me do something specific with the date function.
So my website uses some logic to determine what time of day/day of week it is, and display content accordingly. It all hinges on this variable:
$now = date('l H:i');
Over the weekend, we moved web hosts - to a company in California, and now the dynamic content is always three hours off. I've looked up the
documentation on the function, and it makes my head hurt. What do I do to that variable assignment to add three hours to the result it returns?
posted by jbickers to computers & internet (5 comments total)
This is not the most correct way to do it, and if you switch timezones again, you'll have to change the code again. What you should really do is use this function to change your timezone to "America/New_York".
posted by mkb at 7:19 AM on July 27