Re: epoch from date field

Поиск
Список
Период
Сортировка
От Laurette Cisneros
Тема Re: epoch from date field
Дата
Msg-id Pine.LNX.4.44.0207050916300.4809-100000@visor.corp.nextbus.com
обсуждение исходный текст
Ответ на Re: epoch from date field  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: explicit cast error
Следующее
От: "Leland F. Jackson, CPA"
Дата:
Сообщение: Re: [INTERFACES] MS Access 2K Inform User on Record changes