You do not need to use cellfun to convert your cell array to datetime, but you do need to specify the format of your input string, and since you've got a timezone specified, which timezone you want the datetime in:
c = {'2012-03-12 00:00:00 UTC'
'2010-09-06 00:00:00 UTC'
'2010-10-24 00:00:00 UTC'
'2010-09-06 00:00:00 UTC'
'2012-02-06 00:00:00 UTC'
'2010-09-06 00:00:00 UTC'
'2012-05-22 00:00:00 UTC'
'2011-09-23 00:00:00 UTC'
'2011-06-21 00:00:00 UTC'
'2012-05-30 00:00:00 UTC'
'2012-05-31 00:00:00 UTC'
'2010-10-15 00:00:00 UTC'};
d = datetime(c, 'InputFormat', 'yyyy-MM-dd HH:mm:ss z', 'TimeZone', 'UTC')
The same using cellfun (which as stated is completely unnecessary):
d = cellfun(@(s) datetime(s, 'InputFormat', 'yyyy-MM-dd HH:mm:ss z', 'TimeZone', 'UTC'), c, 'UniformOutput', false);
d = vertcat(d{:})
Best Answer