Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this

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

Hope this helps you.

Regards,

Jagan.

View solution in original post

6 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this post hope it helps you.

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

Regards,

Jagan.

Not applicable
Author

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.

jonathandienst
Partner - Champion III
Partner - Champion III

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
Author

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this

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

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

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.