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) // PT1H30MRelated terms
- daylight saving time — Moving the clocks of a time zone forward in spring and back in autumn, which creates a gap and an overlap in local time.
Taught in
- Dates, Times And Daylight Saving — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: Values And Flow — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep