Sep-18-2021, 04:52 AM
time_stamp will be a timestamp to the second. yesterday is only a date. Only at exact midnight would they be equal. You either want to compare to a range of timestamps or you want to force timestamp to a date.
timestamp_date = datetime.datetime.fromtimestamp(tt).date() if timestamp_date == yesterday: ...