date and time formatting
Ältere Kommentare anzeigen
Hi everyone, i have a csv file which contains date and time cells to be imported and represented in different format in matlab graphs when i convert date and time in matlab it doesnt show the correct date and time although ive used different methods to do that.
- This is one example of date and time format in csv itself (44138.4243609954), this is with general format of cell in excel.
- When i import to matlab it shows this value (44138.4243609954) when i check it in cell
- this is the value that it should show in graph axis after right conversion (2020-11-03 10:11:05.000), note: the time in 24h system.
- the value of date and time that it show instead is (0120-11-04 10:11:79).
Thanks in advance.
3 Kommentare
Rik
am 5 Nov. 2020
It isn't clear to me what the edit was you made, so I don't see how my answer doesn't apply.
omar algburi
am 5 Nov. 2020
I've added the 4th point to clarify it more. There might be some error in time reference, I'm not sure exactly if I have to calibrate in someway but I have no idea. Btw I've checked the link you've posted last comment but it didn't help unfortunately. Thanks anyway.
datetime(44138.4243609954,'ConvertFrom','Excel')
I don't see why my answer wouldn't work for you, as you can see it works in R2020b. If you have trouble applying this to your data, you will have to post your data and the code you tried. If you're not using R2020b you should clarify that as well.
Antworten (1)
Rik
am 5 Nov. 2020
0 Stimmen
See the datetime documentation for how to convert Excel dates to a datetime object that you can use in other functions. See the datetick function for how to set your tick labels to a specific date format.
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!