MATLAB: Dateformats in xls cells

date formats

I read a column with dates in this format: 01.11.2014 00:00:00 I attempt to transform the cell value to datenum, using datevec first. But this dateformat seems not to be accepted in here…
datevec('01.11.2014 01:00:00') gives 2015 1 1 1 0 0 and
>> datevec('01.11.2014')
gives this respons:
"Error using datevec (line 276), Cannot parse date 01.11.2014."

Best Answer

ak - try providing a format string for your first example so that the function "knows" what you consider the year, day, month, etc. For example
datevec('01.11.2014 01:00:00','mm.dd.yyyy HH:MM:SS')
returns
ans =
2014 1 11 1 0 0
A similar format string would be needed for your other example. See datevec for details.