You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the correct way to convert datetime (utc) to [arbitrary] timezone? Looks like this lib supports neither zoneinfo module nor astimezone() method...
To the best of my knowledge the timezone support is limited. There is code in a test here that shows how to convert from the default UTC time into an arbitrary timezone:
After doing so the tzinfo will be set on your object and if you call isoformat() it will output the timestamp with a timezone offset e.g. 2024-11-14T15:49:04-04:00
You could theoretically use timedelta with utcoffset to get the time in the specified timezone, but I do not believe we currently have any support for something more convenient like astimezone(). We would welcome a PR from anyone who wants to add more timezone support that matches cpython.
What is the correct way to convert datetime (utc) to [arbitrary] timezone? Looks like this lib supports neither
zoneinfo
module norastimezone()
method...Example I would like to run in CircuitPython:
The text was updated successfully, but these errors were encountered: