![]() |
|
|
+ Search |
![]()
|
Dec 9th, 2002 09:04
Jonathan Ellis, Brett Stoppel, Sandis Jerics,
You can compare date and timestamp values directly:
select date1 > date2
To do date arithmetic, use intervals:
select date1 + '2 days'::interval
To compare just part of the date, use the date_part function, e.g.
select date_part('day', now()) -- day of the month
select date_part('epoch', now()) -- date in seconds since unix epoch