Duration Formatter

Turn millisecond durations into readable text and ISO 8601

Runs in your browserUtility06Date & Number

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

  1. 1Choose the input unit, milliseconds or seconds.
  2. 2Paste one value per line to convert a whole batch at once.
  3. 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 tools