| Financial Toolbox | Search  Help Desk |
| daysact | Examples See Also |
Actual number of days between dates.
Syntax
nd = daysact(d1, d2) nd = daysact(d1)
Description
nd = daysact(d1, d2)
returns the actual number of days between two dates d1 and d2. Enter dates as serial date numbers or date strings. nd is negative if d2 is earlier than d1.
nd = daysact(d1)
returns the actual number of days between the MATLAB base date and date d1. In MATLAB, the base date 1 is 1-Jan-0000 A.D. See datenum for a similar function.
Either input argument can contain multiple values, but if so, the other input must contain the same number of values or a single value that applies to all. For example, if d1 is an N-row character array of date strings, then d2 must be an N-row character array of date strings or a single date. nd is then an N-by-1 vector of numbers.
Examples
nd = daysact('7-sep-1997', '25-dec-1997')nd =109nd = daysact('9/7/1997')nd =729640d1 = ['09/07/1997'; '10/22/1997'; '11/05/1997']; nd = daysact(d1, '12/25/1997') nd = 109 64 50
See Also
datenum, datevec, days360, days365, daysdif