| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Terry Lee Tucker <terry(at)esc1(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Daylight Savings Time |
| Date: | 2006-04-21 21:47:39 |
| Message-ID: | 14050.1145656059@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Terry Lee Tucker <terry(at)esc1(dot)com> writes:
> I need to know if there is a convienient way of establishing whether DST is
> active within a function dealing with adjusting timestamps to other time
> zones. The problem is that if I have the following timestamp:
> '04/21/2006 17:05 EDT'
> and I use the timezone() function in the following manner:
> return (timezone ('CST', '04/21/2006 17:05 EDT')
> I get a two hour difference in time.
Perhaps you should be using a DST-aware timezone specification? Since
8.1 you could do
regression=# select timezone ('CST6CDT', '04/21/2006 17:05 EDT'::timestamptz);
timezone
---------------------
2006-04-21 16:05:00
(1 row)
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Terry Lee Tucker | 2006-04-21 22:09:37 | Re: Daylight Savings Time |
| Previous Message | Terry Lee Tucker | 2006-04-21 20:46:36 | Daylight Savings Time |