Can i take correct date from this data?

1 visualización (últimos 30 días)
Kostiantyn Voskoboinik
Kostiantyn Voskoboinik el 21 de Abr. de 2020
Comentada: Kostiantyn Voskoboinik el 21 de Abr. de 2020
Hello, i tried to convert my dates from string format to correct date, but i get errors.Can i convert it?
  2 comentarios
the cyclist
the cyclist el 21 de Abr. de 2020
Editada: the cyclist el 21 de Abr. de 2020
It is much more helpful if you upload the data in a MAT file (using the paper-clip icon) than as a screenshot, which we cannot work with directly.
Is your data format equivalent to this?
t = {'Jan 2020','Dec 2019'}; % and so on
Kostiantyn Voskoboinik
Kostiantyn Voskoboinik el 21 de Abr. de 2020
mat file here,
t ={'Apr 2019'}

Iniciar sesión para comentar.

Respuesta aceptada

the cyclist
the cyclist el 21 de Abr. de 2020
Editada: the cyclist el 21 de Abr. de 2020
You need to be precise with the format string.
Try
datetime(t,'InputFormat','MMM yyyy')
  2 comentarios
the cyclist
the cyclist el 21 de Abr. de 2020
Editada: the cyclist el 21 de Abr. de 2020
In the file you uploaded, your data are in a table, so to use this solution, you'd need to convert it first. (It looks like you've already converted in your workspace, since the screenshot shows that it is a cell.)
datetime(table2cell(t),'InputFormat','MMM yyyy')
Kostiantyn Voskoboinik
Kostiantyn Voskoboinik el 21 de Abr. de 2020
Its work,Thank's a lot!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Time Series Objects en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by