Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Calculate epoch time / milliseconds

Hi all,

Can we calculate the epoch timestamp or epoch time in milliseconds on QlikView? e.g. if I wanted to convert 14/11/2016 00:00:00 to epoch. The time in milliseconds would be 1479081600000. Thanks.

1 Solution

Accepted Solutions
sifatnabil
Specialist
Specialist
Author

Got it - you can use this:

=num(date(today(1)))*86400000 - num(date('1/1/1970'))*86400000

This will give you epoch time in milliseconds for a specified date. Qlik is storing dates as the number of days passed from 1/1/1900, whereas epoch time starts from 1970. Converting the date to milliseconds, and subtracting 1970, will give you the correct epoch time.

View solution in original post

3 Replies
sifatnabil
Specialist
Specialist
Author

Got it - you can use this:

=num(date(today(1)))*86400000 - num(date('1/1/1970'))*86400000

This will give you epoch time in milliseconds for a specified date. Qlik is storing dates as the number of days passed from 1/1/1900, whereas epoch time starts from 1970. Converting the date to milliseconds, and subtracting 1970, will give you the correct epoch time.

antoniotiman
Master III
Master III

Hi,

maybe

Interval(Date('14/11/2016 09:08:01')-Date('01/01/1970'),'ssfff')

Regards,

Antonio

vinieme12
Champion III
Champion III

you won't need date() with today()

=num(today(1))*86400000 - num(date('1/1/1970'))*86400000

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.