Taskwarrior supports duration values.
In the core, durations are used directly in one place - the
recur attribute, used for recurring tasks.
For example, here is a recurring task that recurs every monday:
$ task add Take out the trash due:monday recur:weekly
monday is interpreted as 'next monday', and the value
weekly is interpreted as a 7-day duration.
The other place where durations are supported directly is with UDA attributes of type
There is indirect support for durations everywhere that a date value is expected. For example, here is a task due in two days:
$ task add Birthday party due:2days
Whenever Taskwarrior expects a date (due date in this example) but instead finds a duration, it is interpreted as a relative duration added to the current date/time, in this example
now + 2days.
5 secondsFive seconds.
secondOne second. Missing ordinal implies one second.
5 minutesFive minutes.
minuteOne minute. Missing ordinal implies one minute.
3 hoursThree hours.
hourOne hour. Missing ordinal implies one hour.
2 daysTwo days.
dailyOne day. Missing ordinal implies one day.
3 weeksThree weeks.
weeklyOne week. Missing ordinal implies one week.
weekdaysEvery weekday, Monday to Friday.
2 fortnightTwenty eight days.
biweeklyFourteen days. Missing ordinal implies fourteen days.
5 monthsFive months.
monthly30 days. Missing ordinal implies one
monthmonth. This is an imprecise value.
bimonthlySixty one days. Missing ordinal implies two months. This is an imprecise value.
1 quarterlyNinety one days.
quarterlyNinety one days. Missing ordinal implies three months. This is an imprecise value.
semiannualOne hundred and eighty-three days. Missing ordinal implies six months. This is an imprecise value.
1 yearsOne year.
annualThree hundred and sixty-five days. Missing ordinal implies one year. This is an imprecise value.
biannualSeven hundred and thirty days. Missing ordinal implies two years. This is an imprecise value.
ISO-8601 defines a duration format which is supported by Taskwarrior. The format looks like this:
The format always begins with a 'P' (period).
The date elements (
[nY][nM][nD]) are optional, as are the time elements (
[nH][nM][nS]), but there must be one element specified.
Even though the month and minute values use the character 'M', there is no ambiguity because of the placement of the character 'T' which delineates date from time elements.
Here is a list of examples:
P3D- Three days.
P1000D- One thousand days.
P2M- Two months. This is an imprecise value.
P2M3D- Two months and three days. This is an imprecise value.
P1Y- One year. This is an imprecise value.
P1Y3D- One year and three days. This is an imprecise value.
P1Y2M- One year and two months. This is an imprecise value.
P1Y2M3D- One year, two months and three days. This is an imprecise value.
PT50S- Fifty seconds.
PT40M- Forty minutes.
PT40M50S- Forty minutes and fifty seconds.
PT12H- Twelve hours.
PT12H50S- Twelve hours and fifty seconds.
PT12H40M- Twelve hours and forty minutes.
PT12H40M50S- Twelve hours, forty minutes and fifty seconds.
P1Y2M3DT12H40M50S- One year, two months, three days, twelve hours, forty minutes and fifty seconds. This is an imprecise value.
Precise values include days, hours, minutes, seconds. Year and month are not precise because they vary, and can only be made precise if the duration is anchored to a known date.