Monday, November 22, 2010

PHP Putenv - How do I automatically change timezones when daylight savings ?

Hello. i know how to use putenv to change my website timezone.



I am in Auckland New Zealand, and the website clock showed the correct time. However yesterday (sunday) morning, our clocks went forward 1 hour.



so now my website clock is 1 hour out.



Is there some PHP code that will 'automatically' sync with another world clock %26amp; KNOWS when NZ changes to/from daylight savings... %26amp; uses the correct timezone codes.PHP Putenv - How do I automatically change timezones when daylight savings ?
This shouldn't be done on PHP level. Keeping track of system time is the operating system's job. So you should configure your operating system accordingly (or tell your Web hosting company to do it).

No comments:

Post a Comment