Search Postgresql Archives

Re: Converting seconds past midnight to a time

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

 



"Karl O. Pinc" <kop@xxxxxxxx> writes:
> What is the best way to convert an integer number of
> seconds past midnight into a time?

Intermediate 'interval' value seems to work:

regression=# select (99.44 * '1 second'::interval)::time;
    time     
-------------
 00:01:39.44
(1 row)

> On a related note is there some reason why
> interval + int
> does not result in the interval plus int number
> of seconds?

Again, multiplying the number by '1 sec'::interval would get you there.

			regards, tom lane


[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