Determine Time in other Time Zone
От | Marc Wrubleski |
---|---|
Тема | Determine Time in other Time Zone |
Дата | |
Msg-id | 3AA98ED8.C82F3C6C@sorexsoftware.com обсуждение исходный текст |
Ответы |
Re: Determine Time in other Time Zone
|
Список | 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 по дате отправления: