MATLAB: Convert any datetime to english datetime

convertdatetimeinternationalizationMATLAB

Hi!
I need to check when a file was last time changed to mayby update it. The problem is that these dates gotten by 'dir()' are in Finnish. I've tried the following:
file = dir(path);
date = file.date; % '03-heinä-2018 10:18:05'
englishDate = datetime(date, 'Locale', 'fi_FI');
englishDateTry2 = datetime(date, 'Locale', 'system');
But this returns
"Could not recognize the date/time format of
'03-heinä-2018 10:18:05' using the locale 'fi_FI'. You can specify a format character vector using the
'InputFormat' parameter."
and for the 'system'
Could not recognize the date/time format of '03-heinä-2018 10:18:05' using the locale 'fi_FI'. You can specify a format character vector using the
'InputFormat' parameter.
I'd like the user to be able to use computer on whatever language he/she pleases. Is there a way to archieve this using matlab? The matlab always returns it's datetimes in English, Ie. "03-Jul-2018 11:46:57".

Best Answer

How about this?
date=datetime(file.datenum,'ConvertFrom','datenum');