Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to convert a time number to timestampe

Hi

I have a field called Connect_time, that contains a decimal(15,0) - how can I convert it to a timestamp?

For example:

1424723409169

1424723982770

I'll expect something close to '23-02-2015 21:30:00'

Kind regards, Soren

6 Replies
simospa
Partner - Specialist
Partner - Specialist

Hi,

try with:

=UTC(Connect_time)

Let me know.

S.

Anonymous
Not applicable
Author

You can use QV functions.

Create a Js function - Edit Module to do the conversion.

convertToDateFromMs(s){

if(s=null || s='') return '';

if(s.length!=13) return '*';

// substring - 2 args - initial position (0...) and final position

res=s.substring(0,2)||'-'||s.substring........;

return res;

}

Anonymous
Not applicable
Author

=timestamp((25569+(Connect_time+3600000)/(1000*24*3600)))

You can test it with the actual value like this.

=timestamp((25569+(1424723409169+3600000)/(1000*24*3600)))

Anonymous
Not applicable
Author

Can I use UTC in my load script?

simospa
Partner - Specialist
Partner - Specialist

Yes you can.

S.

Anonymous
Not applicable
Author

Thanks for all you fine answers.