MATLAB: CSV Input date format

date time string csv import date format

Hello,
I'm trying to import a date string such as '01/10/2018 16:09:26,934';
However when doing the following:
DateString = '01/10/2018 16:09:26,934';
formatIn = 'MM/dd/yyyy HH:mm:SS,sss';
datetime(DateString,'InputFormat',formatIn)
It returns the following error:
Unable to parse '01/10/2018 16:09:26,934' as a date/time using the format 'MM/dd/yyyy HH:mm:SS,sss'.
Any ideas?

Best Answer

The seconds are lower case 'ss', the fractional seconds uppercase 'SSS':
formatIn = 'MM/dd/yyyy HH:mm:ss,SSS'