J2000 Time Converter
This is a simple javascript converter between j2000, unix time, and javascript date formats.
To install: npm install j2000
Usage:
var converter = ; var unixTime = converter;// unixTime = 949185759.316 var j2000Time = converter;// j2000Time = 2457828.5
You can also convert Javascript dates:
var converter = ; var april1st = 2016 3 1; // Note that Javascript months are 0-indexedvar j2000Time = converter;// j2000Time = 512766069.184 var myDate = converter;// <Date Object> 2016-04-01T07:00:00.000Z
Bonus constant
You can get the number of leap seconds since the year 2000:
var leapsec = NUM_LEAP_SEC_SINCE_2000;
Install from source
Check out this repository. Then run npm install
(or yarn install
).
Run tests
npm run test