How to convert the format of a date?
7 次查看(过去 30 天)
显示 更早的评论
Dear all, I have a vector with different dates. I converted the different dates with datenum. The format was dd:mm:yyyy mm:hh:ss before I converted the time points to numbers. Now I want to change the format! I want only dd:mm:yyyy. Do I have to convert the dates back to a string to change the format or can I do it with a number? All I want, is to delete the mm:hh:ss! But finally the date should be a number again! Thank you in advance!
0 个评论
采纳的回答
Azzi Abdelmalek
2013-3-28
编辑:Azzi Abdelmalek
2013-3-28
datestr(yourdate,'dd:mm:yyyy')
To remove duplicate date, You can use
unique(datestr(yourdate,'dd:mm:yyyy'),'rows')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!