Re: Time Zone names
| From: | Dotan Cohen | Date: | Wed, 13 Jul 2005 17:04:50 +0000 |
| Subject: | Re: Time Zone names | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218628@lists.php.net to get a copy of this message | ||
On 7/13/05, Richard Lynch <ceo@l-i-e.com> wrote:
> I'd like to generate a list of time zones (EST, CDT, whatever) for a popup.
>
> Seems like it should be easy...
>
> This is so the Sales guy can just plug in the time and zone of who he's
> gotta call back, and I stuff that in the database, and he gets a morning
> report of who to call.
>
> <?php
> for ($offset = 0; $offset <= 23; $offset++){
> $z = ???;
> echo "<option>$z</option>\n";
> }
> ?>
>
> What can I use for ??? to get the time zone name for offsets?
>
> The date() function tells me what time zone the webserver is in, which is
> not even *HIS* time zone, much less the client's.
>
> The idate() function is not available.
>
> I can't just shove $offset into putenv("TZ=$offset") -- Apparently, in
> order to set TZ I would need to know, a priori, the name of the time zone,
> so that's not real helpful for what I need.
>
> I looked at all the User Contributed notes, and none seemed to answer it.
>
> I suppose I could Google for "PHP time zone" but...
>
> What am I missing?
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Richard,
Take a look at wikipedia's timezone page. You could probably parse the
table and get what you want. And it's GPL.
http://en.wikipedia.org/wiki/Time_zone
Dotan
http://lyricslist.com/lyrics/artist_albums/299/krauss_alison.php
Krauss, Alison Song Lyrics