-
First Check
Commit to Help
Example Code
DescriptionSo the previous code runs easily with:
But it crashes if I add timezone information
The error I'm given is: Operating SystemWindows Operating System DetailsNo response Typer Version0.12.3 Python VersionPython 3.9.7 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! You can find the answer to your question in the documentation here: https://typer.tiangolo.com/tutorial/parameter-types/datetime/#custom-date-format In short, Typer allows you to specify the date formats that should be used instead of relying on the default ones. You can edit your code to something like this:
With |
Beta Was this translation helpful? Give feedback.
Hi!
You can find the answer to your question in the documentation here: https://typer.tiangolo.com/tutorial/parameter-types/datetime/#custom-date-format
In short, Typer allows you to specify the date formats that should be used instead of relying on the default ones.
You can edit your code to something like this:
With
%z
referring to the timezone offset (see here) and then it should be able to parse your input string.