Skip to content

addtodate

Add a quantity to a date.

R = addtodate(D, Q, F)

Returns the serial date number D plus Q units of the time unit F'year', 'month', 'day', 'hour', 'minute', 'second', or 'millisecond'.

next_month = addtodate(now, 1, 'month')
in_an_hour = addtodate(now, 1, 'hour')
  • now — Current date and time as a serial date-time number.
  • datevec — Convert a date to a 6-element date vector.