Skip to content

Instantly share code, notes, and snippets.

@thure
Created May 1, 2014 21:15
Show Gist options
  • Save thure/70eda867ff3f416a18ce to your computer and use it in GitHub Desktop.
Save thure/70eda867ff3f416a18ce to your computer and use it in GitHub Desktop.
A module for translating Microsoft enigmata into standard goodness. Currently only gives a JS Date from DateTime.Ticks. So… just one enigma for now.
define(function(require, exports, module){
exports.dateFromTicks = function(ticks){
try {
var sec = Math.round(ticks / 1e7);
sec -= 1.16444736e10;
return new Date(sec * 1e3);
}catch(err){
return null
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment