Re: Determine Time in other Time Zone - Mailing list pgsql-general

From Russell Hires
Subject Re: Determine Time in other Time Zone
Date
Msg-id 200103290306.TAA15399@swan.prod.itd.earthlink.net
Whole thread Raw
In response to Determine Time in other Time Zone  (Marc Wrubleski <mlwruble@sorexsoftware.com>)
List pgsql-general
I don't think I've got anything useful to add except maybe to offer some
thoughts.

First, do your users use postgres from their machine via ssh? The Web? Some
other way? If it's from the web, perhaps you could include some code about
localtime and have that sent to your server when people log in. If it's via
ssh I don't know. Maybe you could write a short script that would poll the
remote machine's timezone data...(<major shrug> I'm an amateur! :-)

Second, perhaps this sort of problem has been solved via the ntp software?
ntp polls various time servers. Perhaps there is a way to call a timeserver
that is local to where ever the users are logging in from.

Third, so far I haven't mentioned postgresql in any of this. But it sounds
like it's just a matter of taking externel information and making it
internal...

Oh well, these are just my thoughts!

Russell

____________________________________________________
  _its_ (no apostrophe) means "the thing that it owns"
  _it's_ (with apostrophe) means "it is"


----------
>From: will trillich <will@serensoft.com>
>To: pgsql-general@postgresql.org
>Subject: Re: [GENERAL] Determine Time in other Time Zone
>Date: Tue, Mar 27, 2001, 1:15 AM
>

> On Fri, Mar 09, 2001 at 07:18:00PM -0700, Marc Wrubleski wrote:
>> I need to determine the users time in another Time Zone for the
>> time now().
>>
>> I tried to manually add or subtract the difference of hours
>> between the server timezone and the other timezone, but I have
>> to do it for _Every_ timezone. Not only that, but I need to
>> take Daylight Saving Time (DST) into account for those
>> timezones that use it.
>>
>> I have tried the timezone(text,timestamp) function, but for
>> that to work with daylight savings time I need to know whether
>> the DST is being applied for this date. Ie I have to give the
>> function either MST or MDT, and I don't know how to switch it
>> based on now() and the timezone.
>>
>> I know that I can set the postgres timezone to a timezone
>> defined within Linux's /usr/share/zoneinfo, and that adjusts
>> the local time properly including DST.
>>
>> What I want is a way to ask for the time in a different time
>> zone and use the Linux zoneinfo to calculate it.
>>
>> Does anyone know have an idea how I can solve this problem?
>> Would anyone else be able to use this functionality?
>
> did you ever get a response on this? it looks interesting and
> useful...
>
> --
> will@serensoft.com
> http://newbieDoc.sourceforge.net/ -- we need your brain!
> http://www.dontUthink.com/ -- your brain needs us!
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Consistent pg_dump's
Next
From: Doug McNaught
Date:
Subject: Re: Determine Time in other Time Zone