How do I read a text file and convert the dates and time?

 Respuesta aceptada

jonas
jonas el 25 de Jul. de 2018
Editada: jonas el 25 de Jul. de 2018
Your format string is wrong, try
datenum(tt,'yyyy-mm-dd HH:MM');
better yet, use datetime

Más respuestas (1)

Peter Perkins
Peter Perkins el 3 de Ag. de 2018
It's likely that you want to read the file using readtable, and if you are using a recent version of MATLAB, you will get datetimes automatically. If not, you can convert to datetime after importing.
You are better off using datetime than datenum.

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 25 de Jul. de 2018

Editada:

el 15 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by