Search Postgresql Archives

Re: how to convert float to timestamp in single select query

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

 



On Sun, Mar 29, 2015 at 8:52 PM, Maulik Shah <mauliks@xxxxxxxxxxxxxxxxx> wrote:
Dear Sir/Madam


how to convert float to timestamp in single select query

for exp. i have float as 1.251152515236 ,

i want to convert this to datetime and from datetime to timestamp...
i.e. 02:22:044456

​You imply that (float) 1.251152515236 is equal to (time) 02:22:044456​

I have no clue what formula:  f(x) = ?x? would satisfy f(1.251152515236) = '02:22:044456'::time

Once you answer that you can either inline said formula or create a user-defined function to encapsulate it.  See the documentation for the how.

David J.


[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