Re: unix timestamp - Mailing list pgsql-admin

From Steve Crawford
Subject Re: unix timestamp
Date
Msg-id 4DB1B2B3.40605@pinpointresearch.com
Whole thread Raw
In response to unix timestamp  (Marc Fromm <Marc.Fromm@wwu.edu>)
List 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 by date:

Previous
From: Erwin Brandstetter
Date:
Subject: DELETE FROM pg_description WHERE ...
Next
From: Mario Splivalo
Date:
Subject: Re: Reseting statistics, cluster wide