Re: Thoroughly confused about time zones

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Rob Richardson <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Thoroughly confused about time zones
Date: 2011-02-28 15:24:57
Message-ID: CB170368-2F7D-4AF0-8AE3-BD3EC36D9F78@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 28, 2011, at 8:18 AM, Rob Richardson wrote:

> But when I tried this:
>
> select cast (extract(epoch from ('2010-3-14 12:00'::timestamptz - '2010-3-13 12:00'::timestamptz)) as integer) / 60 / 60
>
> I got 23, showing that even if I did not specify what time zone I’m talking about, I got the correct answer.

You didn't specify the time zone, so it used your local time zone info--but not just your current offset from UTC, rather the offsets from UTC at the dates/times specified.

--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
http://www.elevated-dev.com/
(303) 722-0567 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2011-02-28 15:29:16 Re: Permission denied when inserting
Previous Message Rob Sargent 2011-02-28 15:22:34 Re: Permission denied when inserting