Search Postgresql Archives

TIMESTAMP difference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, is there a way to get the difference in hours between two timestamps? The HH{1,}:MM:SS format will do.

foo=> select timestamp '20071211 00:00' - timestamp '20071210 00:01';
 ?column?
----------
 23:59:00
(1 row)

foo=> select timestamp '20071211 00:00' - timestamp '20071209 01:00';
    ?column?
----------------
 1 day 23:00:00
(1 row)

Any way to make it return "47:00:00" instead? select interval '47:00:00' is still a legal interval as far as postgresql goes.

8.3-beta2 (can't get to beta4: freebsd ports are yet frozen :(

Thanks.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux