-
Notifications
You must be signed in to change notification settings - Fork 31
IP-based time using io.receive_time() returning UTC #95
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
Comments
So..... I checked it again, and I'm leaving this open in case it's an intermittent bug. Feel free to close it if you think it was a glitch. |
Possibly related? |
Just to note I've added an optional timezone argument to the The timezone/tz argument is left off of the request by default so still uses a timezone based on geo-location mapping for the clients IP address, and that falls back to UTC on lookup failure. |
I tested on a Feather S3 TFT and a PicoW with That along with the flexibility to pass in a desired timezone argument now is enough to consider this resolved for me. Please feel free to re-open or create new issue if anyone is still having this issue. |
The AdafruitIO library does not provide the option to provide the
tz
parameter to specify timezone, which is the first thing IO looks for to return a time when usingio.receive_time()
.The second thing IO tries is "guessing" your timezone based on your IP address. This does not appear to be working; it is instead defaulting to UTC.
The final thing IO does is return UTC, which as said above, is happening regardless.
I tested it on a Feather ESP32-S3 TFT board, using CircuitPython 8.0.0-beta.4 and this library. I get UTC from
io.receive_time()
, every time.cc: @brentru @lorennorman @jwcooper
That said, in my project code, I received a workaround for this issue from @jepler in the form of a class in my code. This really only helps if you want to make a workaround in this library, versus fixing the feature in IO itself. But I thought it was worth including either way.
Which is used when instantiating the
io
object as follows:The text was updated successfully, but these errors were encountered: