I have an SQLAlchemy DB column which is of type datetime:
type(<my_object>) --> sqlalchemy.orm.attributes.InstrumentedAttribute
How do I reach the actual date in order to filter the DB by weekday()
?
I got it:
from sqlalchemy import func
(func.extract(<my_object>, 'dow') == some_day)
dow stands for 'day of week' The extract is an SQLAlchemy function allowing the extraction of any field from the column object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With