date computations in a table
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
Peter Perkins
el 2 de Jun. de 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 comentario
Andrei Bobrov
el 3 de Jun. de 2017
Thank you Peter!
Categorías
Más información sobre Dates and Time en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!