On Thu, 18 Mar 2004, PostgreSQL Bugs List wrote:

> Having two timestamps it is common need to know how many
> seconds/minutes/hours/days/etc. passed from one to the other. However there
> is no easy way to do this task.
>
> The basic idea is subtracting the two timestamps. However it gives a data
> type called "interval". The thing I would like to have is a function that
> takes the "interval" and outputs it's length. Currently when I want a

date_part('epoch', intervalval)
 or
EXTRACT(EPOCH FROM intervalval)
 gives the number of seconds in the interval as per the documentation of
these functions in the date/time functions and operators section of the
documentation.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to