Skip to content

Sunrise, sunset times are off by 4 hours (UTC versus local time) #222

Answered by cosinekitty
achalmers asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @achalmers and welcome to the project! Your code looks great, and everything is working correctly. The 4 hour discrepancy is because the times are reported in UTC, not local time. Astronomy Engine does not know anything about time zones. It does everything in UTC. It turns out time zones are extremely complicated: the boundary lines are complicated and the rules change frequently at the whim of governments around the world. I decided early on that time zone support is out of scope for Astronomy Engine.

Usually you can use your operating system (C/C++, Python), browser (JavaScript), or language runtime (C#) to convert to local time. For example, in the linux_riseset.c demo, you can see …

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@achalmers
Comment options

Answer selected by achalmers
Comment options

You must be logged in to vote
6 replies
@achalmers
Comment options

@cosinekitty
Comment options

@achalmers
Comment options

@cosinekitty
Comment options

@achalmers
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants