Version of str(timedelta) which is not English specific.
(duration)
| 16 | |
| 17 | |
| 18 | def duration_string(duration): |
| 19 | """Version of str(timedelta) which is not English specific.""" |
| 20 | days, hours, minutes, seconds, microseconds = _get_duration_components(duration) |
| 21 | |
| 22 | string = "{:02d}:{:02d}:{:02d}".format(hours, minutes, seconds) |
| 23 | if days: |
| 24 | string = "{} ".format(days) + string |
| 25 | if microseconds: |
| 26 | string += ".{:06d}".format(microseconds) |
| 27 | |
| 28 | return string |
| 29 | |
| 30 | |
| 31 | def duration_iso_string(duration): |