Duration and TTL Converter
Convert a duration between seconds, minutes, hours and days, HH:MM:SS, ISO 8601 (PT1H30M), Go duration syntax and plain English, for TTLs and timeouts.
Free · No sign-up · Your inputs stay in your browser
Input
Convert a duration between formats
Output
1 hour, 30 minutes
| Seconds | 5,400 |
|---|---|
| Milliseconds | 5,400,000 |
| Minutes | 90 |
| Hours | 1.5 |
| Days | 0.063 |
| HH:MM:SS | 01:30:00 |
| ISO 8601 | PT1H30M |
| Go time.Duration | 1h30m0s |
| Human | 1 hour, 30 minutes |
ISO 8601 months and years have no fixed length; here a month counts as 30 days and a year as 365, which is fine for TTLs and wrong for calendars. Laravel's cache, session and queue settings take seconds or minutes depending on the key (SESSION_LIFETIME is minutes), so check the unit before pasting.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Check the unit before pasting
Configuration files disagree about units. Laravel's Cache::put() takes seconds, SESSION_LIFETIME takes minutes, Redis EXPIRE takes seconds and PEXPIRE milliseconds, Nginx accepts 30s or 5m, and Kubernetes probes take seconds. A TTL off by a factor of 60 is one of the most common caching bugs.
ISO 8601 durations
The format is P, then years, months, weeks and days, then T and hours, minutes and seconds: PT15M is fifteen minutes and P1M one month. Months and years have no fixed length, so a converter has to assume one; this one uses 30 and 365 days. PHP's DateInterval and Java's Duration parse the format, as does the schema.org structured data for videos and recipes.