Closed tsuckow closed 1 year ago
If you pass any other format to the API it errors out so that's why it's the way it is right now. I agree that I should add better handling so you can pass in tz aware datetimes and have it reformat them as needed.
Doing some old issue cleanup. One of the previous releases improved this so that you can pass either unaware utc time or an aware time and it will handle formatting. I've tried to swap to using only aware times personally.
You blindly append 'Z' to the end of datetimes which causes problems if the datetime has timezone information. (Such as trying to feed start_time from the output of one request into another)
I'm not sure if only
Z
is accepted by the api but it would probably be better to use timezone aware datetimes. To convert datetime aware datetimes to be utc without tzinfo I'm usingstart_time.astimezone(datetime.timezone.utc).replace(tzinfo=None)