MATLAB: How to get creation date of files

creation date

How can I get the creation date of file? I can get modified date with dir command but not the creation date.

Best Answer

Try this FEX submission:
Or on windows you can call the DOS command:
but their advice is not quite correct, it actually needs to be like this:
>> [~,str] = dos('dir /T:C *.m');
>> rgx = '(\d{4}\.\d{2}\.\d{2}\.\s+\d{2}:\d{2})\s+\d+\s+([^\n]+)';
>> tkn = regexp(str,rgx,'tokens');
>> tkn{:}
ans =
'2016.03.02. 11:51' 'startup.m'
ans =
'2016.06.07. 15:29' 'Untitled.m'
And then it reads the creation date perfectly!