Change date format in vector

1 visualización (últimos 30 días)
Davide Cerra
Davide Cerra el 20 de Ag. de 2020
Respondida: Binbin Qi el 20 de Ag. de 2020
Hello i would like to uniform 2 different date format in a single vector:
4/1/2019 12:45:00 AM and 15/6/19 18:10
how can i do that?
  2 comentarios
Davide Cerra
Davide Cerra el 20 de Ag. de 2020
The vector itself contains the 2 formats
Walter Roberson
Walter Roberson el 20 de Ag. de 2020
What is the data type being used? A vector of datetime only has one format associated with it.

Iniciar sesión para comentar.

Respuesta aceptada

Binbin Qi
Binbin Qi el 20 de Ag. de 2020
t1 = datetime("4/1/2019 12:45:00 AM",'InputFormat',"dd/MM/yyyy HH:mm:ss a");
t2 = datetime("15/6/19 18:10",'InputFormat',"dd/MM/yy HH:mm");
t = [t1, t2]

Más respuestas (0)

Categorías

Más información sobre Dates and Time 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