Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
qbi_soren
New Contributor II

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

Tags (1)
6 Replies
Partner
Partner

Re: How to convert a time number to timestampe

Hi,

try with:

=UTC(Connect_time)

Let me know.

S.

bestofwest
Contributor II

Re: How to convert a time number to timestampe

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;

}

Re: How to convert a time number to timestampe

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

qbi_soren
New Contributor II

Re: How to convert a time number to timestampe

Can I use UTC in my load script?

Partner
Partner

Re: How to convert a time number to timestampe

Yes you can.

S.

qbi_soren
New Contributor II

Re: How to convert a time number to timestampe

Thanks for all you fine answers.