Convert serial number dates to month and year
조회 수: 8 (최근 30일)
이전 댓글 표시
I have a date (736473) that i want to convert to month and year. How do i go about doing that ?
댓글 수: 0
채택된 답변
추가 답변 (1개)
Walter Roberson
2018년 7월 23일
dv = datevec(736473);
year = dv(:,1);
month = dv(:,2);
댓글 수: 1
Walter Roberson
2018년 7월 23일
If you want the result as a cell array of character vectors, then you can use
datestr(736473:736475,'yyyy-mm')
for example.
Note that for datestr(), the coding for month is lower-case m, but that for the newer datetime(), the coding for month is upper-case M.
참고 항목
카테고리
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!