isostructured-data

How to use the totalTime parameter in ISO 8601 for Google Structured Data?


I'm playing around with Google rich results. I created HowTo markup for an article. The docs.

One of the parameters (in JSON-LD) is totalTime. The docs say that this should be given in ISO 8601 format. I would like to say '5 minutes' in ISO 8601 format. How do I use this?

In the docs, Google gives an example: 3 days. This is defined as P2D.

I searched on the internet, but I couldn't really find a simple solution about how this works. Can anyone explain the basics of this and how to convert time intervals like "x minutes"?

I would be very grateful if somebody could explain this to me?


Solution

  • This provides a more detailed explanation of the format:

    https://en.wikipedia.org/wiki/ISO_8601#Durations

    5 minutes would be PT5M. Period, Time, 5 Minutes.