Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Parse milliseconds to Date value

Hello everyone,

I have a field that represents the time in milliseconds passed since 1970 00:00:00 GMT that I need to convert into Date value GMT+1 (DD.MM.YYYY hh:mm:ss). I was looking through all functions but was not able to find an easy one that works.

visitTime: 1300888876000  -->  23.03.2011 15:01:16

Thanks in advance!

1 Solution

Accepted Solutions
MVP
MVP

Re: Parse milliseconds to Date value

Hi,

Check this

= Date(MakeDate(1970, 1, 1) +round(1300888876000/1000)/(60*60*24))

Hope this helps you.

Regards,

Jagan.

6 Replies
MVP
MVP

Re: Parse milliseconds to Date value

Hi,

Check this post hope it helps you.

http://community.qlik.com/message/88554#88554

Regards,

Jagan.

Not applicable

Re: Parse milliseconds to Date value

Hi jagan,

thanks for your reply but this is not exactly what I was looking for. The function

time(MillisecondsField/(1000*60*60*24),'hh:mm:ss')

or

interval(MillisecondsField/(1000*60*60*24),'hh:mm:ss')

returns the time of the day but that is just a pice of the pie.

MVP
MVP

Re: Parse milliseconds to Date value

Hi

This should do it:

Date(MillisecondsField/(1000*60*60*24),  'DD.MM.YYYY hh:mm:ss')

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Parse milliseconds to Date value

Hi

thanks for the suggestions but the given formular returns a year value from 1942

Date(MillisecondsField/(1000*60*60*24),  'DD.MM.YYYY hh:mm:ss')

MVP
MVP

Re: Parse milliseconds to Date value

Hi,

Check this

= Date(MakeDate(1970, 1, 1) +round(1300888876000/1000)/(60*60*24))

Hope this helps you.

Regards,

Jagan.

Not applicable

Re: Parse milliseconds to Date value

Brililant!

Date(MakeDate(1970, 1, 1) +round(1300888876000/1000)/(60*60*24))

returns the  Date of the year,

interval(MillisecondsField/(1000*60*60*24),'hh:mm:ss')

the time of the day.

Thanks for your help.

Community Browser