Skip to main content

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").

Parameter

Type

dateValue

datetime, date, time, datetimestamp, gyear, gyearmonth

quantity

integer

units

string

Returns: date

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)
{
}

Run query

Results:

date_add

2001-01-02