Search Postgresql Archives

Calculating the difference between timetz values

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

 



Hello,

I was looking for a way to get the difference (interval) between 2 timetz values, i.e.:

postgres=# select '2:45+7'::timetz - '2:44+2'::timetz;
ERROR: operator does not exist: time with time zone - time with time zone
LINE 1: select '2:45+7'::timetz - '2:44+2'::timetz;

I'd expect the result of the above to be the interval of 05:01:00. Is there any function or operator that calculates the difference correctly ? I've found a way to cast a timetz to the time without TZ and substract resulting time values, but it's not a correct solution for the problem above due to the loss of all TZ information.

Regards,
--
Alexey Klyukin       http://www.CommandPrompt.com
The PostgreSQL Company - Command Prompt, Inc.


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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