Unix Technical Forum

Re: Time Zone design issues

This is a discussion on Re: Time Zone design issues within the Pgsql General forums, part of the PostgreSQL category; --> Alvaro Herrera wrote: > novnov escribió: >> I think I get the picture; this post is the closest to ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 10:43 PM
Troy Rasiah
 
Posts: n/a
Default Re: Time Zone design issues



Alvaro Herrera wrote:
> novnov escribió:
>> I think I get the picture; this post is the closest to making sense to me (my
>> lack of understanding is the issue, obviously). But:
>>
>> What's the postgresql client, in a web app?
>>
>> When you write "The web app sets timezone='EST5EDT' and inserts a time of
>> '2007-07-11 12:30:00'." that's the black box that I'm asking about. There is
>> no web app other than the one I am writing. So, I think it means I need to
>> write code in my web app to handle the conversion of the postgres stored UTC
>> into user-relevant time, with their local time zone etc.

>
> You are misunderstanding the "sets timezone=". What it means is that
> you call the following SQL command:
> SET timezone TO 'EST5EDT';
> early in your webapp code. The value to use, you get from the user
> profile (stored in a table perhaps).


Sorry for the ignorance...but what defines a session in this context in
say..perl

Would it be something like

$dbh = DBI->connect();

do your set timezone stuff here
do your insert

$rc = $dbh->disconnect;


>
>> If that's so, what I'm asking about is one the webapp side and perhaps
>> people here are not so used to dealing with that. I don't know. Just
>> like one of the other (much appreciated) responders in this thread
>> suggested, the user's browser is likely offering the user's tz
>> info...but I am interested in seeing someone's mature system for
>> returning the user's local time based their tz as stored in their
>> profile.

>
> I wouldn't trust the browser's TZ, and you would need a way to override
> it. So storing it in a table seems the easiest way.
>


--
Troy Rasiah

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com