How import data and change data and time format?
Show older comments
formatspec='%f%f%f%f%f%f%{MM-dd-yyyy HH:mm:ss}D%{MM-dd-yyyy HH:mm:ss.SSSSSS}D'
formatspec=variable
%f- format for MATLAB, floating decimal, not sure why so many
{}-desired format for code
D%- no idea
D- no idea
If someone could please help me to understand what this string means, I could appreciate it. I received help on this, but cannot remember why we developed the string in this way.
Accepted Answer
More Answers (1)
Usama Khalid
on 27 Nov 2021
0 votes
Facing the same error, any help?
ds.SelectedVariableNames = {'Date_Time','Usage','AC_DR','UPS','LR','Kitchen','AC_Dr','AC_BR'};
ds.SelectedFormats = {'%{MM/dd/yyyy HH:mm:ss}D','%f','%f','%f','%f','%f','%f','%f'};
PreRaw = readall(ds);
1 Comment
Usama Khalid
on 27 Nov 2021
the error:

Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!