From seema_56@yahoo.com Fri May 25 15:16:46 2001 Received: from pop.sat.net.pk ([202.133.64.2]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4PFGgA49309; Fri, 25 May 2001 11:16:46 -0400 (EDT) (envelope-from seema_56@yahoo.com) Received: from noor ([202.133.67.31]) by pop.sat.net.pk (8.11.2/8.11.1) with SMTP id f4Q1EUp23758; Fri, 25 May 2001 20:14:35 -0500 (GMT) Message-ID: <004601c0e52d$1af00340$0100a8c0@noor> From: "Seema Noor" To: Cc: Subject: time difference Date: Fri, 25 May 2001 20:12:16 +0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0037_01C0E556.FE45A860" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200105/124 X-Sequence-Number: 1535 This is a multi-part message in MIME format. ------=_NextPart_000_0037_01C0E556.FE45A860 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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() =3D 2001-05-25 01:00:00+5 and second timestamp =3D 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 fact= or involved i.e. if now() =3D 2001-05-25 23:00:00+5 and second timestamp =3D 2001-05-24 01:00:00+5 then is there any function to get their difference equal to '46:00:00' inst= ead of '1 22:00:00' ? please reply me soon. ------=_NextPart_000_0037_01C0E556.FE45A860 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
i want to calculate the session time. my query is this

select n= ow()=20 - '2001-05-19 12:09:00+5;

it gives the difference in date and differ= ence=20 in time separately. if the
current time is greater than the second time = then=20 it gives simply their
difference but i want to calcutate the session tim= e=20 from these two times.
if now() =3D 2001-05-25 01:00:00+5
and second timestamp =3D 2001-05-24 23:00:00+5
 
then how can i get their time differernce EQUAL TO '3:00:00' instead o= f=20 '21:00:00 ago' ?
 
and is there a way to get the total time difference including the date= =20 factor involved i.e.
if now() =3D 2001-05-25 23:00:00+5
and second timestamp =3D 2001-05-24 01:00:00+5
then is there= any=20 function to get their difference equal to '46:00:00' instead of '1 22:00:00= '=20 ?
please reply me soon.
------=_NextPart_000_0037_01C0E556.FE45A860-- From quadratini@sni.ph Fri Jun 28 03:53:24 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 6D655476E8F for ; Thu, 27 Jun 2002 23:53:24 -0400 (EDT) Mailbox-Line: From quadratini@sni.ph Thu Jun 27 23:53:24 2002 Received: from ns.sni.ph (ns.sni.ph [210.23.103.9]) by postgresql.org (Postfix) with ESMTP id 6A1B1476ABB for ; Thu, 27 Jun 2002 23:52:27 -0400 (EDT) Received: (from root@localhost) by ns.sni.ph (8.11.6/8.11.6) id g5S3qVE27296 for pgsql-sql@postgresql.org; Fri, 28 Jun 2002 11:52:31 +0800 (PHT) Received: from sni.ph ([210.23.103.26]) by ns.sni.ph (8.11.6/8.11.6) with ESMTP id g5S3qU227231 for ; Fri, 28 Jun 2002 11:52:30 +0800 (PHT) Message-ID: <3D1BDEEF.50409@sni.ph> Date: Fri, 28 Jun 2002 11:58:39 +0800 From: q u a d r a User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: time difference X-scanner: scanned by SNI 1.0.10 - (http://www.sni.ph) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.30 X-Spam-Level: X-Archive-Number: 200206/378 X-Sequence-Number: 8343 I have a query that returns ?column? ----------------- 6 days 01:56:14 (1 row) How can I get it as total number of hours? Instead of days and hours, I need hours only (all in all, so 24hours * 6 days + 01:56:14) Can you help me please? Thanks