-
Notifications
You must be signed in to change notification settings - Fork 43
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
Incompatible ISO8601 format returned by the API #226
Comments
jooola
changed the title
Invalid ISO8601 format returned by the API
Incompatible ISO8601 format returned by the API
Jun 30, 2023
jooola
added a commit
to jooola/hcloud-python
that referenced
this issue
Jun 30, 2023
jooola
added a commit
that referenced
this issue
Jun 30, 2023
* fix: handle Z timezone in ISO8601 datetime format Fixes #226
The API is also returning ISO8601 datetime with microseconds precision, some of those microseconds precision (depending on the precision) aren't parsable by Example: >>> from datetime import datetime, timezone
>>> datetime.fromisoformat('2023-06-30T15:09:46.37719+00:00')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid isoformat string: '2023-06-30T15:09:46.37719+00:00'
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Current Behavior
The floating IP API documentation is using the following ISO8601 format:
2016-01-30T23:55:00+00:00
, but the API currently returns a different ISO8601 format:2023-06-29T15:37:22Z
.We recently removed the
python-dateutil
package because we assumed the API will return the format in the documentation (without theZ
), and usedatetime.datetime.fromisoformat
to parse the datetime.Python <3.11 does not support parsing the
2023-06-29T15:37:22Z
ISO8601 format, and this breaks our client for all version of Python <3.11.Input Code
On python 3.9
Expected behavior/code
The client should be able to parse the ISO8601 format.
Environment
Possible Solution
Z
with+00:00
.Additional context/Screenshots
The text was updated successfully, but these errors were encountered: