Page 1 of 1

Display local time

Posted: Tue Jun 05, 2007 6:07 pm
by ngungo
To display time I used:

Code: Select all

echo date('H:i ', time());
But that is GMT time. How do I display my local (Houston, TX, USA) time same as in my computer?
Thanls in advance.

Posted: Tue Jun 05, 2007 6:09 pm
by feyd

Re: Display local time

Posted: Tue Jun 05, 2007 8:22 pm
by ngungo
I got it, thanks!

Code: Select all

putenv(TZ="America/Chicago");
 echo date('H:i ', time());