converting timestamps to ints

From: Morgan Curley <mcurley(at)e4media(dot)com>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: converting timestamps to ints
Date: 2001-08-03 03:50:58
Message-ID: 4.3.2.7.2.20010802232942.026cf950@e4media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I am writing an app that will need to do some calcs based on differences
between when a record is first inserted and when it is last updated.
I have seen a lot of column::data-type in this list but can't find the
relevant section in the documentation. Can anyone point me in the right
direction?

Currently I am using some code I have seen earlier on this list
select username, extract( epoch from update_timestamp) - extract( epoch
from create_timestamp) as time_diff from users;

Is there a simpler way to do this?

Thanks,
Morgan

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-08-03 04:25:40 Re: converting timestamps to ints
Previous Message Josh Berkus 2001-08-02 22:36:03 Re: More Database Design Stuff