Use time deltas to convert milliseconds into duration. http://docs.python.org/2/library/datetime.html#datetime.timedelta
from datetime import timedelta
# Convert 600000ms (10 minutes) back to duration value.
milliseconds = timedelta(milliseconds=600000)
print milliseconds
# 0:10:00
Thanks for the gist. Is there another method that converts the duration according to a specific pattern? For example, it will take milliseconds and convert it to minutes and seconds only. An approach that doesn't care about the remaining milliseconds.
E.g