Simple example:
declare @timeMoment float
set @timeMoment = 1.251152515236
select @timeMoment as floatValue, cast(@timeMoment as DateTime) as datetimeValue
Result:
floatValue datetimeValue
1.251152515236 1900-01-02 06:01:39.577
More smooth:
declare @timeMoment float
declare @datetimeValue datetime
set @timeMoment = 1.251152515236
set @datetimeValue = cast(@timeMoment as DateTime)
select Right('00' + Cast(DATEPART(hh, @datetimeValue) as varchar(2)), 2) + ':'+
Right('00' + Cast(DatePart(mi, @datetimeValue) as varchar(2)), 2) + ':'+
Right('00' + Cast(DatePart(ss, @datetimeValue) as varchar(2)), 2) + '.'+
Cast(DatePart(ms, @datetimeValue) as varchar)
in SQL Server the long SELECT Right..... ca also be changed to:
select cast(@datetimevalue as time) test