relativedate PowerHome formula function
Description
Obtains either a date or datetime that occurs a specified number of days after or before a given date or datetime.
See the
Date / Time Functions section for detailed information concerning date / time formats.
If only a date value is given the returned value will be only a date (see first example below), but if a datetime value is given then the retuned value will also be a datetime. (See examples 2-3 below).
Syntax
relativedate ( date, n )
Argument |
Description |
date
|
A date or datetime value
|
n
|
An integer indicating the number of days
|
Return value
Date or DateTime. Returns the date or datetime that occurs n days after date if n is greater than 0. Returns the date/datetime that occurs n days before date if n is less than 0.
Examples
The following examples demonstrate typical syntax/usage for this function.
• relativedate(2015-01-15, 2) --> evaluates to: 01/17/2015
• relativedate(2015-01-15 10:05:00, 2) --> evaluates to: 01/17/2015 10:05:00
• relativedate(today(), 2) --> evaluates to: 01/17/2015 10:12:31:654