date computations in a table
古いコメントを表示
I have a table LC that has a column of dates called "date". The date format is however 19850331. I want to extract the year and the month of this date. How can I do so?
採用された回答
その他の回答 (1 件)
Peter Perkins
2017 年 6 月 2 日
Andrei provided the right answer if those data are text, e.g. '19850331' or "19850331". If they are numeric, use
datetime(LC.Date,'ConvertFrom','yyyymmdd')
1 件のコメント
Andrei Bobrov
2017 年 6 月 3 日
Thank you Peter!
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!