Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Convert Unix epoch date time into normal date and vice versa

Hi ,

 

I have a one of the requirement where we have to convert epoch time into normal date and while calling apis again need to convert normal date time into epoch time.

Epoch time is like : 1584202999000 and 1584288399000  and its in milliseconds.

another query how to convert today's date into similar 13 digit epoch time including millisencond.

 

 

 

 

2 Replies
Highlighted
Contributor III
Contributor III

Re: Convert Unix epoch date time into normal date and vice versa

Hi, I can help with getting the Unix Time to normal timestamp value, but haven't done it the other way around.

hope this helps, try this in you load script;

 

"TimeStamp(Makedate(1970,1,1)+ [Unix Time Field] /24/60/60 + Date((120/24/60) , 'YYYY-MM-DD hh:mm:ss')) as Timestamp"

***

in my case the "Unix Time" was GMT, I just added 2 hours for my required time zone { + Date((120/24/60) }

Highlighted
Digital Support
Digital Support

Re: Convert Unix epoch date time into normal date and vice versa

If Phillip's post got you what you needed, please be sure to close out the thread by using the Accept as Solution button on his post.  

I did find a Document post that might be helpful too:

https://community.qlik.com/t5/Qlik-Sense-Documents-Videos/Dealing-with-date-formats-in-QlikView-and-...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.