Created
May 1, 2014 21:15
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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