function dn = datenum(t)
%DATENUM Convert datetimes to serial date numbers.
%   
%   DATENUM is not recommended. Use datetime to represent points in time,
%   and duration or calendarDuration to represent elapsed times.
%   
%   See also DATETIME.
%   


%   Copyright 2016-2022 The MathWorks, Inc.

if isdatetime(t)  || isduration(t) || iscalendarduration(t) ...
        || isnumeric(t) || isstring(t) || iscellstr(t) || ischar(t)
    dn = codistributed.pDatetimeDurationCommon(@datenum, [3 6], t);
    
else
    % Other types are not supported
    error(message('parallel:array:UnsupportedFunction', upper(mfilename), underlyingType(t)));
    
end


