Convert serial number dates to month and year
5 ビュー (過去 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!