ph_relativedatetime PowerHome formula function
Description
Given a valid datetime value (either the output of a function eg, datetime() or a datetime 'literal' value such as 2010-12-15 12:30:00 ) and a number representing the number of minutes to be calculated in the future (positive number) or in the past (negative number) this function determines a new datetime value. Partial minutes are expressed as decimal numerbs (eg 2 minutes and 30 seconds would be 2.5). If only a date is given in the first argument, the time is assumed to be 00:00:00.

See the  Date / Time Functions  section for detailed information concerning date / time formats.

Returns a new datetime value relative to the passed datetime and offset values.

If greater time accuracy is needed, see the ph_relativedtprecise() function.

Syntax
ph_relativedatetime ( dt, n )
Argument Description
dt A datetime value which is the starting datetime.
n A double value representing the number of minutes (partial minutes are in decimal format) in the future (positive values) or the past (negative values) that the new datetime should be offset from the starting datetime.

Return value
Datetime. Returns a new datetime value relative to the starting datetime.

Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_relativedatetime(2015-01-15 00:00:00, 10)--> evaluates to: 12/15/2015 00:10:00
• ph_relativedatetime(today(), 10) --> evaluates to: 01/15/2015 14:37:08