Re: [PHP] timezone problem
Miguel Cruz wrote: In short, I believe it's an OS rather than a PHP thing. time zones can be a messy and tricky beast. all the PHP functions rely on the underlying OS implementation of time zone information. sometimes this is controlled by the TZ environment variable, sometimes it is not. my solution was to extract as much info as reasonable from the zoneinfo database and manipulate it in PHP directly. the solution is not perfect, but is probably the best that can be done without more PHP access to the underlying zoneinfo implementation. my code (with all the time zone data zone IDs) is in PEAR: http://pear.php.net/package-info.php?pacid=57 thanks, baba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] timezone problem
Hi Baba I've been trying to get as much info on this as possible and you are right it is quite messy. Thanks for that link, I'm going to take a look at your code. -Original Message- From: Baba Buehler [mailto:[EMAIL PROTECTED]] Sent: May 21, 2002 5:37 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] timezone problem Miguel Cruz wrote: In short, I believe it's an OS rather than a PHP thing. time zones can be a messy and tricky beast. all the PHP functions rely on the underlying OS implementation of time zone information. sometimes this is controlled by the TZ environment variable, sometimes it is not. my solution was to extract as much info as reasonable from the zoneinfo database and manipulate it in PHP directly. the solution is not perfect, but is probably the best that can be done without more PHP access to the underlying zoneinfo implementation. my code (with all the time zone data zone IDs) is in PEAR: http://pear.php.net/package-info.php?pacid=57 thanks, baba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timezone problem
I had a similar issue, for a thing I'm doing for a Messageboard I am writing I need the timezones and offsets, so I compiled the best I could off different sites and info, and created a Mysql Table with all the timezones and offsets. there are duplicate offsets but since people know their TZ as different things depending where they live. I can do a dump if people would like Chris Riordan http://www.hal-9000.net - Original Message - From: SP [EMAIL PROTECTED] To: Baba Buehler [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 12:47 PM Subject: RE: [PHP] timezone problem Hi Baba I've been trying to get as much info on this as possible and you are right it is quite messy. Thanks for that link, I'm going to take a look at your code. -Original Message- From: Baba Buehler [mailto:[EMAIL PROTECTED]] Sent: May 21, 2002 5:37 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] timezone problem Miguel Cruz wrote: In short, I believe it's an OS rather than a PHP thing. time zones can be a messy and tricky beast. all the PHP functions rely on the underlying OS implementation of time zone information. sometimes this is controlled by the TZ environment variable, sometimes it is not. my solution was to extract as much info as reasonable from the zoneinfo database and manipulate it in PHP directly. the solution is not perfect, but is probably the best that can be done without more PHP access to the underlying zoneinfo implementation. my code (with all the time zone data zone IDs) is in PEAR: http://pear.php.net/package-info.php?pacid=57 thanks, baba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] timezone problem
Here's what I was just thinking. This timezone seems too complicated and what do you guys think about me just displaying all the times in GMT and then allow the user to set to their local time by selecting a pulldown list of all the times GMT -11 to GMT +12. set local time to 1:10pm set local time to 2:10pm set local time to 3:10pm set local time to 4:10pm . . . They would have to change their settings once a year for day light savings but the good thing is I don't have to worry about tz anymore. What do you think? -Original Message- From: Christopher Riordan [mailto:[EMAIL PROTECTED]] Sent: May 21, 2002 1:05 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] timezone problem I had a similar issue, for a thing I'm doing for a Messageboard I am writing I need the timezones and offsets, so I compiled the best I could off different sites and info, and created a Mysql Table with all the timezones and offsets. there are duplicate offsets but since people know their TZ as different things depending where they live. I can do a dump if people would like Chris Riordan http://www.hal-9000.net - Original Message - From: SP [EMAIL PROTECTED] To: Baba Buehler [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 12:47 PM Subject: RE: [PHP] timezone problem Hi Baba I've been trying to get as much info on this as possible and you are right it is quite messy. Thanks for that link, I'm going to take a look at your code. -Original Message- From: Baba Buehler [mailto:[EMAIL PROTECTED]] Sent: May 21, 2002 5:37 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] timezone problem Miguel Cruz wrote: In short, I believe it's an OS rather than a PHP thing. time zones can be a messy and tricky beast. all the PHP functions rely on the underlying OS implementation of time zone information. sometimes this is controlled by the TZ environment variable, sometimes it is not. my solution was to extract as much info as reasonable from the zoneinfo database and manipulate it in PHP directly. the solution is not perfect, but is probably the best that can be done without more PHP access to the underlying zoneinfo implementation. my code (with all the time zone data zone IDs) is in PEAR: http://pear.php.net/package-info.php?pacid=57 thanks, baba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] timezone problem
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] timezone problem
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:[EMAIL PROTECTED]] Sent: May 20, 2002 1:27 PM To: SP Cc: [EMAIL PROTECTED] 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] timezone problem
On Mon, 20 May 2002, SP wrote: 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. I'm not sure about the file format for those time zones - it seems to be some weird binary format. But hopefully your server will have a full complement available. 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? Yup. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php