Last active
February 12, 2021 13:06
-
-
Save danielthiel/8374607 to your computer and use it in GitHub Desktop.
SQLAlchemy: filter by date for an datetime field(does not work with SQLite, with PostgreSQL it works fine)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date | |
from sqlalchemy import cast, DATE | |
Match.query.filter(cast(Match.date_time_field, DATE)==date.today()).all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This worked for me: