note 48598 deleted from function.date by nlopess

From: Date: Fri, 02 Sep 2005 09:39:18 +0000
Subject: note 48598 deleted from function.date by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-94649@lists.php.net to get a copy of this message
Note Submitter: mike at NOSPAM dot markley dot org ---- Regarding timezone handling: Adding 5 to the current hour for Eastern is great, but then you have to deal with daylight savings and know the GMT offset for anything you want to support. However, PHP running as a module under Apache (at least on *NIX; YMMV on Windows) will obey the TZ environment variable, which can be set with putenv(). Any timezone your server supports can be put into that variable, so you can do any of the following: putenv('TZ=EST5EDT'); putenv('TZ=US/Eastern'); putenv('TZ=America/New_York'); date() will then convert the time for you, and the T and Z formats will give back the right information, too.

« previous php.notes (#94649) next »