converting times from excel file using datetime, datestr, and datenum

1 vue (au cours des 30 derniers jours)
Kurt Feigl
Kurt Feigl le 30 Juil 2015
Commenté : Kurt Feigl le 30 Juil 2015
% 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

Réponse acceptée

Sean de Wolski
Sean de Wolski le 30 Juil 2015
datestr uses MM to indicate minutes, you're indicating months above.
datestr(datenum('13:55:20','hh:MM:ss'),'hh:MM:ss')

Plus de réponses (0)

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by