capturing microseconds & computing difference between two dates

From: Robin Keech <robin(at)dialogue(dot)co(dot)uk>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: capturing microseconds & computing difference between two dates
Date: 2000-02-23 14:25:25
Message-ID: 31262893C5E5D2119C4900105A30B3A112D59E@roadrunner.dialogue.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi, I'm pulling my hair out. Can anyone help?

I have a table with start and end dates ... type : TimeStamp. (offers
microsecond resolution according to the docs)
I insert datetime information with microsecond resolution
ie
INSERT INTO table (Start_Date, End_Date) VALUES ('2000-01-01
10:01:00.123456' , '2000-01-01 10:01:00.654321')

What I want is to get the difference between these two times - normally
only microseconds.

However, PostgreSQL 6.5 doesn't seem to hold the microsecond portion, or
if it does it does not display it.

I have set the DateStyle to SQL -> this should stop the default ISO
Format from displaying the timezone difference on the end of the
timestamp (ie +00), but it doesn't.

DateTime is no good for me becasue it only offers millisecond precision
(ie 2 decimal places).

Can anyone help? Should I just relax and get used to counting sunsets
instead?

Thanks
Robin

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Justin Long 2000-02-23 14:35:05
Previous Message Jerome ALET 2000-02-23 13:32:30 problem with grant/revoke