Re: Difference between dates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bastiaan Olij <lists(at)basenlily(dot)nl>
Cc: pgsql Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Difference between dates
Date: 2008-12-24 16:11:14
Message-ID: 11648.1230135074@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Bastiaan Olij <lists(at)basenlily(dot)nl> writes:
> What I'm trying to do is get the difference between two dates either in
> minutes, hours, days, months or years.

Well, you can get the difference in seconds using EXTRACT(EPOCH FROM
timestamp_difference) and then do your own arithmetic ...

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Hyatt 2008-12-25 20:00:24 Re: Fw: Re: connection refused
Previous Message Bastiaan Olij 2008-12-23 23:02:06 Difference between dates