| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Financial Toolbox |
| Contents | Index |
| Learn more about Financial Toolbox |
NumDays = daysact(StartDate, EndDate)
StartDate | Enter as serial date numbers or date strings. |
EndDate | (Optional) Enter as serial date numbers or date strings. |
Either input can contain multiple values, but if so, the other 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.
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 software, the base date 1 is 1-Jan-0000 A.D. See datenum for a similar function.
NumDays = daysact('7-sep-2002', '25-dec-2002')
NumDays =
109
NumDays = daysact('9/7/2002')
NumDays =
731466
MoreDays = ['09/07/2002'; '10/22/2002'; '11/05/2002'];
NumDays = daysact(MoreDays, '12/25/2002')
NumDays =
109
64
50
datenum, datevec, days360, days365, daysdif
![]() | days365 | daysadd | ![]() |
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |