Re: epoch from date field - Mailing list pgsql-general

From Laurette Cisneros
Subject Re: epoch from date field
Date
Msg-id Pine.LNX.4.44.0207050916300.4809-100000@visor.corp.nextbus.com
Whole thread Raw
In response to Re: epoch from date field  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Actually, we use tzset() to set the timezone.  We're not operating in GMT
at all, but it returns GMT.

This, however does work returning the epoch for the current timezone:

select extract(epoch from map_date::timestamp);

So, for some reason extract won't convert a date to timestamp when it's
passed in?

Thanks for the help,

L.
On Thu, 4 Jul 2002, Tom Lane wrote:

> Laurette Cisneros <laurette@nextbus.com> writes:
> > select extract(epoch from date(map_date)) from datemaps;
> > For a date: 2002-07-04
> > it returns 1025740800
> > which apparently translates to today (7/3) at 5pm.  Is this right?
> > Shouldn't it return the epoch for midnight on 7/4?
>
> You're in GMT-7 to judge by your Date: header.  That *is* midnight,
> GMT.
>
>             regards, tom lane
>

--
Laurette Cisneros
The Database Group
(510) 420-3137
NextBus Information Systems, Inc.
www.nextbus.com
----------------------------------
"Intelligence complicates. Wisdom simplifies."
  -- Mason Cooley




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: explicit cast error
Next
From: "Leland F. Jackson, CPA"
Date:
Subject: Re: [INTERFACES] MS Access 2K Inform User on Record changes