Skip to content

Instantly share code, notes, and snippets.

@zircote
Last active January 1, 2016 13:29
Show Gist options
  • Save zircote/8151694 to your computer and use it in GitHub Desktop.
Save zircote/8151694 to your computer and use it in GitHub Desktop.
Explanation of time interval definition.

Duration Data Type

The duration data type is used to specify a time interval. The time interval is specified in the following form "PnYnMnDTnHnMnS" where:

  • P indicates the period (required)
  • nY indicates the number of years
  • nM indicates the number of months
  • nD indicates the number of days
  • T indicates the start of a time section (required if you are going to specify hours, minutes, or seconds)
  • nH indicates the number of hours
  • nM indicates the number of minutes
  • nS indicates the number of seconds

Example: P1Y1M1DT1H1M1S 1 Year 1 Month 1 Day 1 Hour 1 Minute 1 Second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment