I have a cell array (attached) containing dates that look like this:
'1999-01-02T18:24:37Z'
I'd like to get these dates into datenum format, which I can accomplish like this:
ct = char(t{2});d = datenum(str2double(cellstr(ct(:,1:4))),str2double(cellstr(ct(:,6:7))),str2double(cellstr(ct(:,9:10))));
but that seems awfully convoluted and the str2double calls take a tremendous amount of time for long date lists. All I need are the year, month, and day in datenum format. Is there an elegant way to access only the first ten characters in the cell array t?
Best Answer