I have a datetime
object in Python, for, let's say, 25/06/2017 11:22:33
. I'd like to find a pythonic way of getting a datetime
object from that one that would represent 24/06/2017 00:00:00
.
I can think of:
day_before = now - datetime.timedelta(days=1,
hours=now.hour,
minutes=now.minute,
seconds=now.second)
But I was wondering if there is a more concise way.