Matlab - how to convert date format in example provided
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
olayinka ola
am 31 Okt. 2020
Kommentiert: Ameer Hamza
am 31 Okt. 2020
In my code below I am unable to convert the date format in column 1 from dd/MM/yyyy to MM-dd-yyyy. How do I configure it correctly to stop seeing this error??
>> T = readtable("IGEv3.xlsx");
>> tday=T{2:end, 1};
>> tday=datestr(datenum(tday, 'dd-MM-yyyy'), 'MM-dd-yyyy')
Error using datetime/datenum
Too many input arguments.
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 31 Okt. 2020
Bearbeitet: Ameer Hamza
am 31 Okt. 2020
You just need to change the format property of the datetime object
T = readtable("IGEv3.xlsx");
tday = T{2:end, 1};
tday.Format = 'MMM-dd-yyyy';
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!