%% Determine the Number of Days Between Two Dates Based the Actual Number of Days
% Determine the NumDays using date character vectors for StartDate and EndDate.

NumDays = daysact('7-sep-2002',  '25-dec-2002')

%
% Determine the NumDays using a datetime array for StartDate.

NumDays = daysact(datetime('7-sep-2002','Locale','en_US'),  '25-dec-2002')

%
% Determine the NumDays using a vector for EndDate.

MoreDays = ['09/07/2002'; '10/22/2002'; '11/05/2002'];
NumDays = daysact(MoreDays, '12/25/2002')

% Copyright 2012 The MathWorks, Inc.