Microformats testsuite

Microformats duration formats

Introduction

Although microformats use two subsets of ISO 8601 standard to describe dates and times, duration are taken directly from ISO standard.  There are in fact two way different ways to represent a duration in ISO 8601. Both start with the letter P which stands for period. The most common of the two representations is a combination of numbers followed by letters. So P10D stands for 10 days. The second is a variation on the date and time format P0001-02-10 stands for 1year, 2 months and 10 days. Both these representations can be used as microformat duration.  

Representation 1

Summary of rules to create a duration

Representation 1 format examples

ISO 8601 duration format - representation 1 - valid structures 
P9MP1Y2M
P1Y2M10D
P1Y2M10DT20H
P1Y2M10DT20H30M
P1Y2M10DT20H30M30S
P1Y2M10DT20H30M30.5S
P1Y2M10DT20.5H
P110D
PT30M

Representation 2

Summary of rules to create a duration

Representation 2 format examples

ISO 8601 duration format - representation 2 - valid structures 
P0001-02-10
P0001-02-10T14:30:30

Some rights reserved