-
Notifications
You must be signed in to change notification settings - Fork 9
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
Timezone problem #16
Comments
I have found a solution to my question from the last sentence:
Is there any simpler solution? |
I don't know; timezones are hard! If you'd like to improve the docs, a PR is welcome |
I do not know if this is "simpler", but I always like to keep timestamps in epoch. After all, this is just a number.
|
There is a problem to convert times received from get_times() to format "%H:%M:%S %Z" in other time zones than UTC.
I assume that:
sunrise = get_times(date, lat, lon)['sunrise']
saves the sunrise time with local zone instead of UTC.
Maybe the objects returned by get_times should have timezone (UTC) specified?
Please compare:
print(get_times(date, lat, lon)['sunrise'].strftime('%H:%M:%S %Z'))
print(datetime.now().strftime('%H:%M:%S %Z'))
Both gives the answer without timezone info.
How to print the sunrise time, adding timezone info?
The text was updated successfully, but these errors were encountered: