Re: unix timestamp

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: unix timestamp
Дата
Msg-id 4DB1B2B3.40605@pinpointresearch.com
обсуждение исходный текст
Ответ на unix timestamp  (Marc Fromm <Marc.Fromm@wwu.edu>)
Список pgsql-admin
On 04/21/2011 12:19 PM, Marc Fromm wrote:

Is there a way to query a unix timestamp date? In the database the orderdate field is a unix timestamp.

I would like to create the where clause to a query on a specific date like December 17, 2010.

Select * from orders where orderdate = ‘12/17/2010’;

 

Thanks

 

Marc


If by "unix timestamp" you mean epoch, just extract the epoch from your date or timestamp:

steve=# select extract(epoch from date '12/17/2010');
 date_part 
------------
 1292572800

Cheers,
Steve

В списке pgsql-admin по дате отправления:

Предыдущее
От: Erwin Brandstetter
Дата:
Сообщение: DELETE FROM pg_description WHERE ...
Следующее
От: Mario Splivalo
Дата:
Сообщение: Re: Reseting statistics, cluster wide