Duration Formatter (ISO 8601, Humanize)
Convert any duration between three formats: raw seconds (logs and APIs), ISO 8601 duration syntax (calendars, schemas), and humanized strings (UI labels). Paste any of the three and the other two update automatically.
How to use the Duration Formatter (ISO 8601, Humanize)
Type into any of the three fields and the other two update. Seconds is the raw integer form (what databases and logs store). ISO 8601 (P3DT2H15M) is what JSON Schema, OpenAPI, and many calendar systems use. Human-friendly is the form you’d show in a UI label.
Precision and format options affect only the human-friendly output: pick “1 largest unit” for a UI badge (“2h”), “2 largest” for a tooltip (“2 hours 15 minutes”), or “All units” for full precision.
About Duration Formatter (ISO 8601, Humanize)
Every API and database store durations differently. Postgres has interval. Most cloud APIs use seconds. JSON Schema and OpenAPI use ISO 8601 duration syntax. UI components want a human-friendly string. Converting between them is mechanical but error-prone — ISO 8601 has subtle quirks (P always starts the string, time portions live after a T, weeks (W) are exclusive with days/months/years), and humanizing requires deciding whether to round, truncate, or include trailing units.
The breakdown view shows days/hours/minutes/seconds explicitly so you can spot input errors at a glance. The three formatting modes cover the three places you usually need duration strings: terse badges, normal labels, and long-form descriptions.
Common use cases
- UI duration labels — turn a database’s seconds count into “2h 15m” for display.
- JSON Schema field examples — generate ISO 8601 sample values.
- Log analysis — humanize a request-latency value when reporting.
- Cron / scheduler builders — confirm what “every 6 hours” means in seconds.