From: Seema Noor <seema_56@yahoo.com>
To: pgsql-sql@postgresql.org
Cc: pgsql-novice@postgresql.org
Subject: time difference
Date: Fri, 25 May 2001 20:12:16 +0500
Message-ID: <004601c0e52d$1af00340$0100a8c0@noor> (raw)
i want to calculate the session time. my query is this
select now() - '2001-05-19 12:09:00+5;
it gives the difference in date and difference in time separately. if the
current time is greater than the second time then it gives simply their
difference but i want to calcutate the session time from these two times.
if now() = 2001-05-25 01:00:00+5
and second timestamp = 2001-05-24 23:00:00+5
then how can i get their time differernce EQUAL TO '3:00:00' instead of '21:00:00 ago' ?
and is there a way to get the total time difference including the date factor involved i.e.
if now() = 2001-05-25 23:00:00+5
and second timestamp = 2001-05-24 01:00:00+5
then is there any function to get their difference equal to '46:00:00' instead of '1 22:00:00' ?
please reply me soon.
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: seema_56@yahoo.com, pgsql-novice@postgresql.org
Subject: Re: time difference
In-Reply-To: <004601c0e52d$1af00340$0100a8c0@noor>
* 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