Python gets time in minutes
1 answer
import datetime start = datetime.datetime(2009, 1, 31) end = datetime.datetime(2009, 2, 1) diff = end-start print (diff.days * 1440) + (diff.seconds / 60) >> 1440.0
(I'm assuming you don't need microsecond resolution here, but if you do, just add a third term using diff.microseconds
the correct divisor to convert to minutes.)
+3
a source to share