Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHESPTRUFRDEEN

Elysia Tools

Navigation

Development

ISO 8601 Duration Builder

· Last updated:2026-06-20

Convert between natural-language durations and ISO 8601 durations (PnYnMnDTnHnMnS) in both directions with validation of edge cases

Details

What this tool helps you do

Bidirectional converter for ISO 8601 durations. Natural language (e.g. "3 years 2 months 14 days", "2h30m", "3天2小时") parses to canonical P3Y2M14D; ISO strings parse back to readable form with per-component breakdown. Validates the tricky ISO 8601 rules (T-section units, weeks not combined with Y/M/D, decimal only on smallest unit, at least one component).

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team
Days18
Edge15

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Development
Input types
text, select
Output type
html
Sample coverage
4
API ready
Yes

Overview

The ISO 8601 Duration Builder is a bidirectional converter that translates between natural-language durations and canonical ISO 8601 duration strings. It validates complex formatting rules, including T-section separators, decimal placements, and component combinations, while providing a detailed breakdown of each time unit.

When to use

  • When writing configuration files, API payloads, or database schemas that require strict ISO 8601 duration formats.
  • When parsing and debugging complex ISO 8601 duration strings received from external APIs or system logs.
  • When converting user-friendly, natural-language time intervals into standardized machine-readable formats.

How it works

  1. 1Enter a natural-language duration or an ISO 8601 duration string into the input field.
  2. 2Select the conversion direction, or leave it on Auto to let the tool detect the input format.
  3. 3Review the generated output, which displays the converted format alongside a detailed component breakdown.

Use cases

  • Generating standardized duration strings for system configuration files or environment variables.
  • Translating machine-generated ISO 8601 intervals into human-readable text for application dashboards.
  • Validating that duration strings comply with strict ISO 8601 standards before saving them to a database.

Examples

1. Convert Natural Language to ISO 8601

Backend Developer

Background

A developer needs to store a user-defined trial period of '3 months and 10 days' in a database that requires ISO 8601 format.

Problem

Manually formatting the duration string risks syntax errors, especially with the P and T designators.

How to use

Type '3 months 10 days' into the input field and set the direction to 'Natural language → ISO 8601'.

Input: '3 months 10 days', Direction: 'nl2iso'

Outcome

The tool outputs the canonical ISO 8601 duration string 'P3M10D' along with a breakdown of the components.

2. Parse ISO 8601 Duration to Human-Readable Text

Product Manager

Background

A product manager is reviewing API logs containing duration values like 'PT4H30M' and needs to quickly verify the exact time interval.

Problem

Reading raw ISO 8601 strings can be slow and error-prone when scanning multiple logs.

How to use

Paste 'PT4H30M' into the input field and set the direction to 'ISO 8601 → Natural language'.

FAQ

What is the basic format of an ISO 8601 duration?

It follows the pattern PnYnMnDTnHnMnS, where P is the duration designator, Y/M/D represent date units, T is the time designator, and H/M/S represent time units.

Can I mix weeks with other units in ISO 8601?

No, standard ISO 8601 rules state that weeks (W) should not be combined with other date or time units like years, months, or days.

Where can decimal fractions be used in a duration string?

Decimals are only permitted on the smallest, final unit present in the duration string, such as PT1.5H or PT1H30.5M.

What does the 'T' designator signify in the duration string?

The 'T' designator separates date units (Years, Months, Days) from time units (Hours, Minutes, Seconds) to prevent ambiguity between Months (M) and Minutes (M).

Does this tool support negative durations?

The tool validates standard ISO 8601 duration components and outputs canonical positive intervals based on the input provided.

Hub

Define an ISO 8601 Reporting Period and Fiscal Week

Turn a dated reporting anchor and a stated duration into an auditable calendar endpoint, ISO week label and fiscal-quarter assignment.

Home
Tools3201
Samples593
Visualizations465
Viewers103
Hubs233
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance644

Calculators, numerics, date logic, statistics, and finance tools

Design & Color297

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

FLAC/WAV Source Screening and Evidence Handoff
Self-Hosted Giveaway Widget Review and Embed Handoff
Stripe Promo Code Batch Review and Import Preflight
Batch Photo Culling Review and Editing Shortlist Handoff
UI Screenshot Structure Review and Development Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Python

Web Image Processing Python Samples

Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

Java

Android Image Processing Java Samples

Android Java image processing examples including reading/saving images, scaling, and format conversion

Kotlin

Android Image Processing Kotlin Samples

Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

Rust

Web Image Processing Rust Samples

Web Rust image processing examples including image read/save, scaling, and format conversion

Development

Cron Expression Explainer

Parse a 5-part / 6-part / Quartz cron expression into a plain-language schedule description, show the field-by-field breakdown, and list the next N execution times in any IANA timezone — with an AI-generated natural-language explanation in your language

Development

cURL to Go (net/http) Converter

Convert a cURL command into a Go net/http code snippet with http.NewRequest, headers, and body

Development

cURL to JavaScript (axios) Converter

Convert a cURL command into a JavaScript axios code snippet with config object, headers, and data

Development

cURL to JavaScript (fetch) Converter

Convert a cURL command into a JavaScript fetch() code snippet with headers, body, and method

Input: 'PT4H30M', Direction: 'iso2nl'

Outcome

The tool displays the human-readable translation '4 hours 30 minutes' alongside its individual components.