Date & Time

DateAdd

Adds a number of units such as days, months or hours to a date/time value.

Syntax

DateAdd(DateTime, Addition [, Units])

Parameters

DateTime
The starting date/time.
Addition
How many units to add. Use a negative number to subtract.
Unitsoptional
A TimeUnit value such as TimeUnit.Hours. Days if omitted.

Examples

  1. DateAdd(Today(), 7)

    One week from today

  2. DateAdd(Now(), -2, TimeUnit.Hours)

    Two hours ago

Official documentation on Microsoft Learn

↑ ↓ moveEnter open