%% Convert Dates and Times to Excel and .NET Times
% Create an array of datetime values.

D = datetime(2019,10:12,1,12,0,0)

%
% Convert D to an array of double-precision values representing Excel date numbers. (To display all the digits of the date numbers, set the numeric display format to longg.)

format longg
X = convertTo(D,'excel')

%
% Convert D to an array representing dates and times as .NET times. Since .NET times must be unsigned 64-bit integers, convertTo returns an array having the uint64 data type.

X = convertTo(D,'.net')

% Copyright 2019 The MathWorks, Inc.