DST and time zones

From: A Gilmore <agilmore(at)shaw(dot)ca>
To: Postgresql Mailing list <pgsql-novice(at)postgresql(dot)org>
Subject: DST and time zones
Date: 2004-09-18 17:36:31
Message-ID: 414C721F.30107@shaw.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello,

I need a method of returning a date in a given timezone and accomidating
DST. For example, my server is set to UTC, Id like to return the epoch
for Vancouver Canada. You can do a

select extract(epoch from now() at time zone 'pst');

Of course this is wrong since DST is in affect, so it should be 'pdt'
not 'pst'. I understand that postgresql doesn't do this itself, it uses
the OS, however does anyone know a crafty way to get the current time in
any timezone, whether DST is in effect or not?

Im using pg 7.4.3 running on Linux 2.4.25.

Thanks in advance.
A Gilmore

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message brew 2004-09-18 18:49:35 DST and time zones
Previous Message Neacal 2004-09-18 15:32:53 Importing data into postgreSQL from FileMaker?