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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Maulik Shah <mauliks(at)rosconsultancy(dot)in>, pgsql-general(at)postgresql(dot)org
Subject: Re: how to convert float to timestamp in single select query
Date: 2015-04-01 13:41:43
Message-ID: 551BF597.6040006@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-04-01 13:45:37 Re: stack builder
Previous Message Bill Moran 2015-04-01 13:41:31 Re: Would like to know how analyze works technically