How to convert the format of a date?
조회 수: 5 (최근 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!