Skip to content

A.JulianDay.dateToJD forces UTC, giving wrong times if dates differ #21

Description

@mrk-psvc

I could be missing something, but:

I am currently in UTC+2. Dates and times are all returned fine except between midnight and 2AM. In this period UTC date is one day behind the actual date; the times and other data provided are then actually for yesterday. I can't convert them after they're returned because they're given as seconds from midnight and there's no way for me to know if that is today or tomorrow (talking about the Moon now).

I think it's because A.JulianDay.dateToJD forces UTC and ignores any timezone offset, which I suppose there's a good reason for. However, this causes incorrect times when local date and UTC date are different.

This actually forces me to do two separate calculations every time. One with date with added timezone offset and one with actual date. If I send date with forced added offset to A.JulianDay times will be correct, but topographic positions will be off. So I do one calculation for rise/set times (with forced UTC offset sent to A.JulianDay) and another with actual date (for topographic position).

Maybe I misunderstand something. How to get around this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions