Reply to Re: How to Enumerate and Calculate Timezones?

Your name:

Reply:


Posted by Gordon Burditt on 06/14/07 04:23

>In a web database (PHP), per user, I'd like to allow each user to specify
>their timezone (this would change how times are adjusted for display for
>that user).
>
>How do I enumerate all possible timezones from a PHP script or compiled 'C'
>program?

There are an infinite number of possible timezones. Most of them,
such as the one exactly 100 * pi hours west of GMT, are not used
by anyone (at least not anyone sane).

>Given a specific timezone, how do I get the time adjustment from UTC (which
>can vary, based on daylight savings rules)?

You can get a list of tzinfo-supplied timezones in PHP with
timezone_abbreviations_list() or timezone_identifiers_list(). For
C, you could try enumerating the files in the tzinfo directory.
You may get multiple names for the same time zone. For the offset,
look at timezone_offset_get(). However, it may be much simpler to
just use the time zone specified as the local time zone and use
functions such as localtime() or date() to compute human-readable
local times.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация