Duration Formatter
Turn millisecond durations into readable text and ISO 8601
What is Duration Formatter?
A duration formatter converts a number of milliseconds or seconds into a readable breakdown in days, hours, minutes, and seconds, a clock-style string, and an ISO 8601 duration such as P1DT2H3M4S. It accepts one value per line for bulk conversion, which makes short work of elapsed-time fields pulled out of logs. Conversion happens locally in your browser.
How to use Duration Formatter
- 1Choose the input unit, milliseconds or seconds.
- 2Paste one value per line to convert a whole batch at once.
- 3Take the readable breakdown, the clock format, or the ISO 8601 form, whichever you need.
Frequently asked questions
How do you read an ISO 8601 duration?+
P marks the value as a period, and everything after T is the time-of-day portion. So P1DT2H3M4S means 1 day, 2 hours, 3 minutes, and 4 seconds. The format turns up constantly in API contracts and config files, and Java Duration.parse along with most other libraries reads it directly.
Why are months and years not included?+
Because their length is not fixed: months run from 28 to 31 days, and years can be leap years. Converting milliseconds into months means assuming an average, and the result will not line up with the real calendar. When you need a calendar-accurate span, use a date difference calculator instead.
Related tools
All toolsUnix Timestamp Converter
Convert Unix timestamps to dates and back, seconds or milliseconds
Timezone Converter
Compare a time across several zones, daylight saving handled for you
Date Difference Calculator
Calculate the gap between dates, including business days
Cron Expression Parser
Parse cron expressions and preview the next run times
Number Base Converter
Convert between binary, octal, decimal, and hexadecimal
Byte Size Converter
Convert storage units, keeping base 1024 and base 1000 apart