How to get the time of 5 minutes ago in python [duplicate] How to get the time of 5 minutes ago in python [duplicate] python-3.x python-3.x

How to get the time of 5 minutes ago in python [duplicate]


You may use datetime.timedelta():

datetime.datetime.now() - datetime.timedelta(minutes=5)