6 Replies Latest reply: Nov 19, 2012 5:07 AM by cotimbaland

# 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

• ###### Re: Parse milliseconds to Date value

Hi,

Check this post hope it helps you.

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

Regards,

Jagan.

• ###### 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.

• ###### 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

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

• ###### 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.

• ###### 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.