ISO-8601 period and duration format

The text form Period and Duration print and parse: P, then years, months and days, then T and hours, minutes and seconds.

In more detail

Period prints only date parts, such as P1Y2M3D, and weeks are stored as days, so Period.ofWeeks(1) prints P7D. Duration prints time parts after PT, such as PT1H30M. A day-based Duration such as Duration.ofDays(1) prints PT24H.

Example

Period.of(1, 2, 3)        // P1Y2M3D
Duration.ofMinutes(90)    // PT1H30M

Related terms

Taught in

References

Certification courses