Convert dates in MATLAB that show up with the opposite year
1 次查看(过去 30 天)
显示 更早的评论
Having some trouble w/ my data.
The dates are showing up wrong. For example:
3/9/9102
3/10/9102
Obviously, i didn't collect data in 9102 and if you read it backwards, its 2019 which would be the correct date.
Does anyone know how to correct for this?
For example, how would you convert
3/9/9102 --> 3/9/2019
If someone knows, let me know. Thanks
1 个评论
Walter Roberson
2022-7-22
Duplicated by later https://www.mathworks.com/matlabcentral/answers/1765405-trouble-using-split-function-in-matlab?s_tid=srchtitle which has solutions
采纳的回答
SAI SRUJAN
2022-7-21
Hi SS,
From my understanding of your question,you want to reverse the year part of the date.Im assuming that the dates are in the string format.The following code snippet might help,
date='3/9/9102';
arr=split(date,'/');
arr(3)=reverse(arr(3));
date=char(join(arr,'/'));
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Install Products 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!