From: Bruno Wolff III <bruno@wolff.to>
To: Roberto Mello <rmello@cc.usu.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: Time difference without intervals
Date: Fri, 8 Nov 2002 12:59:10 -0600
Message-ID: <20021108185910.GA7364@wolff.to> (raw)
In-Reply-To: <20021108182002.GC25961@cc.usu.edu>
References: <20021108182002.GC25961@cc.usu.edu>
On Fri, Nov 08, 2002 at 11:20:02 -0700,
Roberto Mello <rmello@cc.usu.edu> wrote:
>
> Is there any way to make a timestamp difference operation not return an
> interval? I'd like to get hours, minutes and seconds only, not the "1 day"
> or whatnot.
When you take a difference of two timestamps, you are going to get an
interval that does not have a year, month difference component.
You can get the interval value in seconds by using
extract(epoch from interval).
You can then further manipulate this value to get hours, minutes and seconds.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, rmello@cc.usu.edu
Subject: Re: Time difference without intervals
In-Reply-To: <20021108185910.GA7364@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox