Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

jonhester/julian-date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

julian-date npm MIT Build Status CodeCov

Installing via NPM

npm install julian-date

Browser

Browser Download

<script src="julianDate.min.js"></script>
<script>
var j = new JulianDate();
</script>

Create new JulianDate

var JulianDate = require('julian-date');

var j = new JulianDate();

// Get the julian date
j.julian(); // 2457088.5

// Get the javascript date
j.getDate(); // Fri Mar 06 2015 19:00:00 GMT-0500 (EST)


// Get the julian days
j.julianDays(); // 5543.5

Create new JulianDate from julian days or julian date

var JulianDate = require('julian-date');

var j1 = new JulianDate().julian(2457088.5);
j1.getDate() // Fri Mar 06 2015 19:00:00 GMT-0500 (EST)

var j2 = new JulianDate().julianDays(5543.5)
j2.getDate() // Fri Mar 06 2015 19:00:00 GMT-0500 (EST)