The interval
type is used to specify a period of time. It consists of a value and a unit specifier, eg. "3 days". The interval type is very flexible about how it interprets the time unit. In general, the first letter is sufficient to indicate the interval unit. For example, the previous example could be written as "3 d". The time ranges supported are specified in the following table:
Unit specifier |
Abbreviation |
Example Values |
---|---|---|
second |
s |
3 seconds |
minute |
m |
5 minute |
hour |
h |
4 hours |
day |
d |
7 days |
week |
w |
4 weeks |
month |
mo |
5.6 months |
year |
y |
100 years |
If no time unit is provided, the default unit of "days" is used. A numeric value must always be provided or an exception will be thrown. Numeric values may be fractional (e.g. 5.6).
Note
Due to the variable lengths of months and years, approximations are used for these values within Clover. A month is considered to be 30.346 days and a year is considered to be 365.232 days. All other units are exact.