Thursday, February 17, 2011

Changing timezone in PHP

Alright, quick question.

A server is running in Eastern Time. PHP program needs to make date calculations using Central time.

At the moment, I am putting this line at the very top of my script:

putenv("TZ=US/Central");

Is that the best way to go about that or is there some PHP trick I'm not aware of?

Cheers.

From stackoverflow

0 comments:

Post a Comment