Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toDateNumber incorrect #4

Open
unity-github opened this issue Jan 27, 2021 · 1 comment
Open

toDateNumber incorrect #4

unity-github opened this issue Jan 27, 2021 · 1 comment

Comments

@unity-github
Copy link

I've been comparing moon positions with the Horizons calculator and is shows the 'toDateNumber' calculation is incorrect by 1 or 2 depending on rounding.

The correct code should just be:
function toDateNumber(date) { var diff = (date - new Date("2000-01-01T00:00")); return (1 + diff.valueOf()/86400e3); }

@aaghevli
Copy link
Owner

Hey thanks! I may be able to look and fix this. I appreciate the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants