Skip to content

Commit

Permalink
fixed day-rounding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Aug 11, 2012
1 parent 47ecbe2 commit f0a78bf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,18 @@ <h3>Days Since J2000 Epoch</h3>

var lambda = 360 - 137.4;

var lmst = mtc - lambda * 24 / 360;
var ltst = lmst + eot * 24 / 360;
var lmst = (mtc - lambda * 24 / 360);
if (lmst < 0) {
lmst += 24;
} else if (lmst >= 24) {
lmst -= 24;
}
var ltst = (lmst + eot * 24 / 360);
if (ltst < 0) {
ltst += 24;
} else if (ltst >= 24) {
ltst -= 24;
}

$(".millis").text(millis);
$(".jd_ut").text(jd_ut.toFixed(5));
Expand Down

0 comments on commit f0a78bf

Please sign in to comment.