Re: Re: User Timezone
| From: | tamouse mailing lists | Date: | Mon, 22 Oct 2012 01:27:36 +0000 |
| Subject: | Re: Re: User Timezone | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319548@lists.php.net to get a copy of this message | ||
On Sun, Oct 21, 2012 at 6:18 PM, Karl DeSaulniers <karl@designdrumm.com> wrote:
> On Oct 21, 2012, at 5:11 PM, tamouse mailing lists wrote:
>> Using the standard labels in /usr/share/zoneinfo should be able to
>> avoid having to keep track of who is and isn't in DST, *provided* you
>> find a way to map the user's address to one of those files.
>
> I am not familiar with this. Can you elaborate?
/usr/share/zoneinfo contains the time zone information in files and
subdirectories such as:
GMT
PST8PDT
America/Chicago
America/Los_Angeles
Europe/London
Europe/Rome
and so on, for all the various time zones.
You can use these names as strings in most time zone functions that
accept a time zone.
PHP knows about these; you'll find more info at
http://us1.php.net/manual/en/timezones.php
This doesn't help with the original question, finding out which time
zone a user is in, but once you find out, using the canonical names
will be useful without directly having to know if/when a particular
zone is in DST or not. You should never (ever!) have to deal with the
contents of these files; they contain binary data that is used in the
system to deal with figuring out that sort of thing.