We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When saving and loading datetime type information using ODM, timezone information disappears.
To Reproduce
class TestDocs(Document, extra="allow", populate_by_name=True): id: Indexed(str) = Field(..., alias="_id") # type: ignore created: Optional[datetime] = None modified: Optional[datetime] = None
Expected behavior When saving, information should be saved to mongodb and loaded according to the timezone information of the datetime in the model.
Additional context When imported, it is loaded without timezone information.
The text was updated successfully, but these errors were encountered:
Hi,
this is not an issue with Beanie, you have to configure timezone awareness setting in Motor/PyMongo: https://www.mongodb.com/docs/languages/python/pymongo-driver/current/data-formats/dates-and-times/#aware-utc-datetime
Please provide a minimum runnable and reproducible example if the issue still persists.
Sorry, something went wrong.
This issue is stale because it has been open 30 days with no activity.
No branches or pull requests
Describe the bug
When saving and loading datetime type information using ODM, timezone information disappears.
To Reproduce
Expected behavior
When saving, information should be saved to mongodb and loaded according to the timezone information of the datetime in the model.
Additional context
When imported, it is loaded without timezone information.
The text was updated successfully, but these errors were encountered: