Matlab imported excel time format change

2 vues (au cours des 30 derniers jours)
davit petraasya
davit petraasya le 8 Fév 2017
Commenté : davit petraasya le 12 Fév 2017
Hi
Does anyone knows how to change change matlab time format. I have time in 2 colomns, first dd/mm/yyyy and second colomn hh:mm:ss.FFF. I need to make this time in one colomn in format yyyy-mm-dd hh:mm:ss.FFF.
Thanks in advance!

Réponse acceptée

Guillaume
Guillaume le 8 Fév 2017
Assuming the date and time is stored as char arrays in both columns:
dt = datetime(strcat(column1, ' ', column2), ...
'InputFormat', 'dd/MM/yyyy hh:mm:ss.SSS', ...
'Format', 'yyyy-MM-dd hh:mm:ss.SSS')
If you want it back as char arrays:
char(dt)
  1 commentaire
davit petraasya
davit petraasya le 12 Fév 2017
Thanks Guillaume for the answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by