How to convert a column in a table to date format for plotting a time series?
Show older comments
Dear MATLAB friends
I´m struggling with the conversion of a column to the date format. The cells in the row are written as '2012-09-01T00:00:00.000Z' . I want to convert all the cells in the column to dates that I can use for plotting a time series.
Any handy hints for this issue?
Thank you already in advance!
Regards
Tom
Accepted Answer
More Answers (1)
Eric Sofen
on 11 Dec 2020
There's no need to replace the 'T' and 'Z' literals. Datetime formats can include literals:
datetime(Column_of_Time_Strings,'InputFormat',"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!