date_add
The date function used to add some period of duration to a date or datetime value. Takes three arguments, the original date, a number of units of duration to add, and the unit of duration (one of "year", "decade", "century", "quarter", "month", "week", "day", "hour", "minute", "second", or "millisecond").
Returns: date
Table 1.
Parameter | Type |
|---|---|
dateValue | datetime, date, time, datetimestamp, gyear, gyearmonth |
quantity | integer |
units | string |
Example
Query:
PREFIX : <https://ddw-doccorp.linked.data.world/d/sparql-function-sample-queries/>
PREFIX fn: <http://data.world/function/functions#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (fn:date_add("2001-01-01"^^xsd:date, 1, "day") as ?date_add)
{
}Table 2. Results
date_add |
|---|
2001-01-02 |