Forum OpenACS Q&A: Response to PostgreSQL date questions

Collapse
Posted by Don Baccus on
select date_part('epoch', sysdate()) - date_part('epoch', idle_since_date) as idle_seconds from foo;

date_part('epoch', ...) returns the number of seconds from the beginning of the (Unix) epoch, i.e. 1970.