date computations in a table
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (1)
Peter Perkins
am 2 Jun. 2017
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 Kommentar
Andrei Bobrov
am 3 Jun. 2017
Thank you Peter!
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!