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

From Marc Wrubleski
Subject Determine Time in other Time Zone
Date
Msg-id 3AA98ED8.C82F3C6C@sorexsoftware.com
Whole thread Raw
Responses Re: Determine Time in other Time Zone  (will trillich <will@serensoft.com>)
List pgsql-general
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?

Marc Wrubleski
Sorex Software Inc.
Calgary, Alberta, Canada
1 (403) 371-7598



pgsql-general by date:

Previous
From: "De Leeuw Guy"
Date:
Subject: Create trigger problem :
Next
From: tc lewis
Date:
Subject: socket file must reside in /tmp?