Re: Time Zone design issues
От
Richard Huxton
Тема
Re: Time Zone design issues
Дата
Msg-id
46E56807.9060504@archonet.com
Ответ на
Re: Time Zone design issues (novnov)
Список
Дерево обсуждения
Time Zone design issues novnov <novnovice@gmail.com>
Re: Time Zone design issues Tom Lane <tgl@sss.pgh.pa.us>
Re: Time Zone design issues Ron Johnson <ron.l.johnson@cox.net>
Re: Time Zone design issues novnov <novnovice@gmail.com>
Re: Time Zone design issues Martijn van Oosterhout <kleptog@svana.org>
Re: Time Zone design issues novnov <novnovice@gmail.com>
Re: Time Zone design issues Martijn van Oosterhout <kleptog@svana.org>
Re: Time Zone design issues Richard Huxton <dev@archonet.com>
Re: Time Zone design issues "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Time Zone design issues novnov <novnovice@gmail.com>
Re: Time Zone design issues Martijn van Oosterhout <kleptog@svana.org>
Re: Time Zone design issues Alvaro Herrera <alvherre@commandprompt.com>
Re: Time Zone design issues Ron Johnson <ron.l.johnson@cox.net>
Re: Time Zone design issues Tom Lane <tgl@sss.pgh.pa.us>
Re: Time Zone design issues Ron Johnson <ron.l.johnson@cox.net>
Re: Time Zone design issues Gregory Stark <stark@enterprisedb.com>
Re: Time Zone design issues Steve Atkins <steve@blighty.com>
Re: Time Zone design issues "Trevor Talbot" <quension@gmail.com>
Re: Time Zone design issues Troy Rasiah <troyr@vicnet.net.au>
Re: Time Zone design issues Ron Johnson <ron.l.johnson@cox.net>
Re: Time Zone design issues Alvaro Herrera <alvherre@commandprompt.com>
novnov wrote:
> As far as I can see, my original premis is correct, that I need to tweak the
> stored datetime when returned for viewing in a browser to adjust for any
> user's tz setting...I'd be wrong if browsers automatically adjust any
> datetime for the requesting pc's tz setting. I don't think they do, else why
> would web apps like joomla and drupal adjust the datetime presented to the
> end user according to whatever they set at their tz?
>
> Your explanation of now() and localtime() is good...but localtime() to
> postgres acting as a web app db, wouldn't it just return the local time as
> far as the server is concerned?
To be precise, it's as far as the *client library* (e.g. DBD::Pg in
Perl, or your pg_xxx functions in PHP) is concerned.
=> show timezone;
TimeZone
----------
GB
(1 row)
=> select now();
now
-------------------------------
2007-09-10 16:46:51.275526+01
(1 row)
=> SET timezone='EST';
SET
=> select now();
now
-------------------------------
2007-09-10 10:46:51.275526-05
(1 row)
So you'll want to issue the correct "SET timezone" for each user, but
after that it's all handled for you. If the application wasn't web-based
you'd not need to keep re-connecting so you'd only have to do it once.
--
Richard Huxton
Archonet Ltd
В списке pgsql-general по дате отправления