I want to get the last 10 minutes in python to be fully divisible by 10.
It shouldn't round to the next 10 minutes, it must be always previous 10 minutes.
For example, output should be as follows:
2019-10-04 20:45:34.903000 -> 2019-10-04 20:40
2019-10-04 20:48:35.403000 -> 2019-10-04 20:40
2019-10-04 20:42:21.903000 -> 2019-10-04 20:40
2019-10-04 20:50:21.204000 -> 2019-10-04 20:50
2019-10-04 20:59:49.602100 -> 2019-10-04 20:50
import datetime
def timeround10(dt):
#...
print timeround10(datetime.datetime.now())