end-of-time
v1.1.4
Published
In case you're curious, this will give you the end of time. Get ready.
Downloads
10
Readme
End of time is coming!
Description
Totally useless little module that assumes the world will end when the
JavaScript Date.now()
goes above Number.MAX_SAFE_INTEGER
Code
var EndOfTime = function() {
return {
millisecondsToYears : function (ms) {
return Math.floor(ms / (1000 * 60 * 60 * 24 * 356));
},
getThisYear : function(){
return new Date().getFullYear();
},
getMaxYear : function(){
return this.millisecondsToYears(Number.MAX_SAFE_INTEGER);
},
getYearsLeft : function(){
return this.getMaxYear() - this.getThisYear();
}
}
}
module.exports = EndOfTime;
Test
npm test