RE: [PHP] timezone problem
| From: | SP | Date: | Mon, 20 May 2002 21:43:46 +0000 |
| Subject: | RE: [PHP] timezone problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98535@lists.php.net to get a copy of this message | ||
hi miguel
i'm testing on a windows so not sure where the
timezone info would be but what you are saying
that if i port my app to a unix box then it would
be easy to just add the missing timezones in
/usr/share/zoneinfo, right? if that's the case
then i could just test with pacific, eastern and
mountain time for now.
also, do you know if i store all my dates as GMT
then when i convert to different timezones using
putenv, will this take into account the daylight
savings?
-----Original Message-----
From: Miguel Cruz [mailto:mnc@stoic.net]
Sent: May 20, 2002 1:27 PM
To: SP
Cc: php-general@lists.php.net
Subject: Re: [PHP] timezone problem
I think these are system-specific. You'll probably
have to check which
time zone your machine understands. For instance,
on this FreeBSD machine
there are hundreds of them in /usr/share/zoneinfo
but on other machines
there are only a handful.
In short, I believe it's an OS rather than a PHP
thing.
miguel
On Mon, 20 May 2002, SP wrote:
> I am trying to convert date/times to different
> timezones using putenv but I am having problems
> using the right TZ names. I am trying the zones
I
> found here
>
http://fuck.org/~ryan/squirrel/timezone/timezones.
> php but it seems the only ones that work are
> EST5EDT, CST6CDT, MST7MDT, PST8PDT and GMT.
>
> OUTPUT
> =======
>
> May 20 2002 10:46 am Eastern Standard Time
> May 20 2002 3:46 pm Ame
> May 20 2002 3:46 pm Ame
> May 20 2002 10:46 am EST
> May 20 2002 2:46 pm GMT
> May 20 2002 3:46 pm Eur
> May 20 2002 3:46 pm Asi
>
> CODE
> =====
>
> echo date("F j Y g:i a T"), "<br>";
>
> putenv("TZ=America/Los_Angeles");
> echo date("F j Y g:i a T"), "<br>";
>
> putenv("TZ=America/New_York");
> echo date("F j Y g:i a T"), "<br>";
>
> putenv("TZ=EST5EDT");
> echo date("F j Y g:i a T"), "<br>";
>
> putenv("TZ=GMT");
> echo date("F j Y g:i a T"), "<br>";
>
> putenv("TZ=Europe/Paris");
> echo date("F j Y g:i a T"), "<br>";
>
> putenv("TZ=Asia/Hong_Kong");
> echo date("F j Y g:i a T"), "<br>";
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
>
>
>
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02