converting date and time string to datetime object
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Salma fathi
el 30 de Mzo. de 2022
Comentada: VBBV
el 30 de Mzo. de 2022
I am trying to read several text files each has 4 variables, the first coumn has the date and time values otgether in the following format
''2022-02-16T15:50:00.000Z'', and I would like to convert them in the following format "20220216155000".
I would like to convert theis into a datetmir object so i can use these vaues to compare to other dates and times from a different tables.
I am using the following lines for converion
for x = 1:length(Ionotable.x_Time) %x_Time is the column where the date and tie values are stored
Ionotable(x,1) = datetime(string(x),'InputFormat','yyMMddHHmmss');
end
but I am getting the follwoing error
Error using datetime (line 651)
Unable to convert '1' to datetime using the format 'yyMMddHHmmss'.
Error in Ionosonde_Data (line 23)
Ionotable(x,1) = datetime(string(x),'InputFormat','yyMMddHHmmss');
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!