Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group