MATLAB: Converting times from excel file using datetime, datestr, and datenum

datenumdatestrdatetimeexcelMATLABtime

% I started using the following line to convert a time tag from excel to matlab jMatlabDateNum = datetime(S.DateTimePST,'ConvertFrom','excel');
% as suggested in the help page for DATETIME % datetime
% But the following line
datestr(datenum('13:55:20','hh:mm:ss'),'hh:mm:ss')
% gives output that I do not understand
13:07:20

Best Answer

datestr uses MM to indicate minutes, you're indicating months above.
datestr(datenum('13:55:20','hh:MM:ss'),'hh:MM:ss')