The content for this post is all from a gist, hopefully someone finds it useful
Resources
The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.
Saturday, November 12, 2011
Wednesday, November 9, 2011
Postgres: get the number of days in an interval
-- seconds / 60 = minutes / 60 = hours / 24 = days
select (((EXTRACT(EPOCH FROM INTERVAL '2 years') / 60) / 60) / 24)::integer as number_of_days
good resource - http://stackoverflow.com/questions/952493/how-do-i-convert-an-interval-into-a-number-of-hours-with-postgres
Labels:
postgresql
Subscribe to:
Posts (Atom)