r = addtodate(d, q, f)
| Parameter | Description |
|---|---|
| d | serial datenum. |
| q | quantile to add to date |
| f | 'year', 'month', 'day', 'hour', 'minute', 'second', or 'millisecond. |
| Parameter | Description |
|---|---|
| r | date number. |
r = addtodate(d, q, f) adds quantity q to the indicated date field f of a scalar serial date number d, returning the updated date number r.
t = datenum('07-Apr-2008 23:00:00');datevec(t)
t2 = addtodate(t, -2, 'hour');datevec(t2)
t3 = addtodate(t, 4, 'hour');datevec(t3)
| Version | Description |
|---|---|
| 1.0.0 | initial version |