Not sure if this will fully answer your question, but to get just the date portion of a timestamp you can recast the timestamp as date by:
select your_timestamp_column::date
So in my table there are a number and a timestamp row, there are multiple numbers per day
its like:




number
timestamp




3
20.02.2021 16:05:00


7
20.02.2021 16:10:00


20
20.02.2021 16:15:00


5
21.02.2021 16:00:00




now i want the average of the numbers of the day of 20.02.2021 but i don't know how i should do that with SQLAlchemy
any suggestions?
How to query only the date in a timestamp