Skip to content

Instantly share code, notes, and snippets.

@ralfbecher
Last active March 30, 2019 17:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbecher/3dd6fa134eefacb18f40 to your computer and use it in GitHub Desktop.
Save ralfbecher/3dd6fa134eefacb18f40 to your computer and use it in GitHub Desktop.
JavaScript function to create a Date from QlikView or Qlik Sense numerical Date value
function dateFromQlikNumber(n) {
var d = new Date(Math.round((n - 25569) * 86400000));
// since date was created in UTC shift it to the local timezone
d.setTime(d.getTime() + d.getTimezoneOffset() * 60000);
return d;
}
@ralfbecher
Copy link
Author

Thanks Speros for pointing this out! Wonder how that came in..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment