Re: Time zone in date function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31/01/2012, at 2:55 PM, Ron Piggott wrote:

> 
> 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


You can set the timezone for your script using date_default_timezone_set() http://php.net/manual/en/function.date-default-timezone-set.php
---
Simon Welsh
Admin of http://simon.geek.nz/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux