Financial Toolbox    
daysact

Actual number of days between dates

Syntax

Arguments

StartDate
Enter as serial date numbers or date strings.
EndDate
(Optional) Enter as serial date numbers or date strings.

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 StartDate is an n-row character array of date strings, then EndDate must be an n-row character array of date strings or a single date. NumDays is then an n-by-1 vector of numbers.

Description

NumDays = daysact(StartDate, EndDate) returns the actual number of days between two dates. Enter dates as serial date numbers or date strings. NumDays is negative if EndDate is earlier than StartDate.

NumDays = daysact(StartDate) returns the actual number of days between the MATLAB base date and StartDate. In MATLAB, the base date 1 is 1-Jan-0000 A.D. See datenum for a similar function.

Examples

See Also

datenum, datevec, days360, days365, daysdif


  days365 daysdif