Date Time calculation help

From: "Unnikrishnan Menon" <unnikrishnan(dot)menon(at)chennai(dot)transys(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Date Time calculation help
Date: 2002-01-14 14:58:39
Message-ID: 005e01c19d79$16219db0$e90aa8c0@UNNIKRISHNAN
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have a particular query in Oracle :

select mod((sysdate - to_date('15-JAN-02','dd-mon-yy')),1) from dual;
The above query gives 0.752.. as the difference between the two days which when multiplied by 24 gives around 3.1.. hrs.

I tried the same query in postgresql but the value returned is 0.
The query was:
select mod((current_date - '2002-15-01')),1);

I require the difference in time to the last second to be shown as time left. Could anyone suggest as to how to overcome this particular problem.

Thanx in advance,

Unni

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-01-14 16:47:14 CREATE TABLE glitch -fix request for 7.2
Previous Message Unnikrishnan Menon 2002-01-14 05:18:31 Re: Problems with PL/PGSQL - functions