timestamp difference in hours? (fwd)

From: Alessandro Rossi <alex(at)sunrise(dot)radiostudiodelta(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: timestamp difference in hours? (fwd)
Date: 2000-09-29 19:46:12
Message-ID: Pine.LNX.4.05.10009292145470.30216-100000@sunrise.radiostudiodelta.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

---------- Forwarded message ----------
Date: Sat, 23 Sep 2000 15:58:06 +0200 (CEST)
From: Alessandro Rossi <alex(at)sunrise(dot)radiostudiodelta(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: timestamp difference in hours?

I found in a post from Jeff MacDonald the following example:

bignose=> \d foo
Table "foo"
Attribute | Type | Modifier
-----------+-----------+----------
start | timestamp |
stop | timestamp |

bignose=> select start,stop, stop-start as start_stop from foo;
start | stop | start_stop
------------------------+------------------------+------------
2000-06-22 20:37:12-03 | 2000-06-22 20:37:12-03 | 00:000
2000-06-22 20:40:40-03 | 2000-06-23 20:40:40-03 | 1 00:00
2000-06-22 20:40:53-03 | 2000-09-30 20:40:53-03 | 100 00:00
2000-06-22 20:41:08-03 | 2000-06-23 02:41:08-03 | 06:00
2000-06-22 20:41:30-03 | 2010-11-22 19:41:30-04 | 3805 00:00
(5 rows)

Is it possible to get the start_stop field in hours ?
And not in days, hours ?

ex: 1 00:00 -> 24:00

In postgres what is the difference between
the type datetime and timestamp?

Thanks in advance

Alex

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Mc Graw 2000-09-29 23:20:34 Re: invoke an external shell script from a function
Previous Message Peter Eisentraut 2000-09-29 16:31:27 Re: invoke an external shell script from a function