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 03/29/2015 08:52 PM, Maulik Shah wrote:
Dear Sir/Madam


how to convert float to timestamp in single select query

for exp. i have float as 1.251152515236 ,

test=> select to_timestamp(1.251152515236);
         to_timestamp
-------------------------------
 1969-12-31 16:00:01.251153-08


The above assumes your value is seconds since epoch, which I am pretty sure is not the case here.


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

Well the above is a time not a datetime or timestamp, so I am not really sure what you are after? In other words more context is needed about where the value is coming from and what other information is available to anchor it to a datetime.


I need sql query


It is actually .crd file made in xml , and i have query inside xml like


<![CDATA[
SELECT USER.LastName, USER.fltime from Tbalname


]>



fltime has float value which i need to convert to time


Regards
Maulik Shah




--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


--
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