Datetime, parsing problem
显示 更早的评论
I am using Datetime function for a set of 104 excel data, but in some of the data I face with parsing error, although all the files have the same format and the excel cell that will be used in the datetime also is the same in all the data sets but datetime give error that it can not parse the
why this happens and how I can Solve it?
6 个评论
Walter Roberson
2019-6-7
How are you reading the file?
Which release are you using? And are you using MS Windows on a system with Excel installed?
Would it be possible for you to attach one of the failing files?
dpb
2019-6-7
Walter's correct that would likely have to have a failing file to be able to diagnose the issue...
dpb
2019-6-7
[Answer moved to comment--dpb]
I read my files with xlsread and they seem to be ok because I used these commands for other things, The Error that it gives meis that it cannot 'Parse' the data not reading the file
it seems that the format of the cell with date is different, but i checked it and its all the same!!!
dpb
2019-6-7
Well, there's nothing we can do for you unless and until you attach one of the failing files for somebody else to test with...
Walter Roberson
2019-6-10
In datatime parsing, you cannot use SS to indicate that you want 12 digits of fractions of a second. You would need to use 12 S's to indicate 12 digits of fractions of a second. However, MATLAB only permits 9 S's, so your 09:55:46.663917949583 cannot be processed. MATLAB cannot store seconds that precise. You will need to process the times to reduce it to 9 digits.
采纳的回答
更多回答(2 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!