MATLAB: Trying to break apart date string

datadatestringtable

I have a table with a column that has a large string for the date, I want to isolate certain digits and separate them for example if I have date = 2.016010100000000e+11 I want yyyy = date(1:4) MM = date(5:6) dd = date(7:8) HH = date(9:12)
The only problem is that I want to do this for the entire table, is there a way to? Thank you

Best Answer

>> val = 2.016010100000000e+11;
>> str = sprintf('%u',val)
str = 201601010000
>> vec = datevec(str,'yyyymmddHHMM')
vec =
2016 1 1 0 0 0