-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add gmtime() to time module #1663
Comments
I was looking into this and want to make sure I understand what is needed. However -- when we have an internet connection and us the adafruit_ntp library to set the time, it sets it to GMT. Do we need to add Time zone awareness and then return localtime or gmtime as requested? I am thinking that was is now referred to as localtime should really be gmtime and if local time requested, use the Time Zone setting to offset it.. edited to add.. Is that what you have in mind? Or have I missed the point entirely... |
I think you've got it. The primary objective is to be able to determine local time accurately based on gmtime when it's available. The nice-to-have would be to calculate gmtime from local time when an actively-updated gmtime isn't available. Since the flag is available, calculating and including the DST offset would be frosting on the cake. |
Slightly confused - are we saying that currently if not, how does it figure out what local time should be? it doesn't seem to automagically pick up the timezone from secrets.py (my timezone is currently == UTC, which makes it harder to spot potential issues!) |
Add
gmtime()
to support foundational timekeeping in UTC to permit conversion tolocaltime()
or when calculating the UTC offset for a local timezone. See discussion: adafruit/Adafruit_CircuitPython_PyPortal/issues #16The text was updated successfully, but these errors were encountered: