A time interval specification is a hash type that is used to specify some block or offset in time based on logical units. It consists of a unit, count and alignment flag. However, in some contexts the alignment or count may be ignored. For example, a time interval may be "one minute", meaning that it applies a change in time by adding a single minute to the input.

The structure of the time interval itself is a hash map type with three possible keys under it.

Units

The units the time interval is specified in. This is an enumeration type with the possible values:

  • Millisecond

  • Second

  • Minute

  • Hour

  • Day

  • Week

  • Month

  • Quarter

  • Year

Count

The integer number of units to apply.

Align

The boolean alignment flag. When set to true, the resulting time of applying the time interval is aligned to a unit boundary.

An additional short hand form of time intervals is available by replacing the entire key with a single integer. In this form the number specifies the number of seconds with the alignment being implied.

One minute time
/Units,"Minute"
/Count,1
Three days aligned
/Units,"Day"
/Count,3
/Align,TRUE
Short hand five minutes
/,300