I’m testing the new release candidate (7.0.90) on Windows 10 20H2. I noticed that I cannot use existing code to determine a file’s timestamp because datevec() doesn’t accept the datestring’s format from ctime() anymore. In Octave 6.4.0 this worked and gives the datevec of the temporary file:
fid = tmpfile; fileinfo = stat(fid); datevec(ctime(fileinfo.mtime)(1:end-1),'ddd mmm dd HH:MM:SS yyyy') fclose(fid);
But in Octave 7.0.90 I get
error: datevec: multiple day specifiers in ddd mmm dd HH:MM:SS yyyy error: called from datevec>__date_vfmt2sfmt__ at line 256 column 5 datevec at line 144 column 44 datevec_bug at line 3 column 1
Apparently, datevec() is bothered by the day being specified as both a weekday and a day of the month. However, I cannot change the output of ctime().
My workaround follows this (confusing) graph Date/Time functions - Octave and works on both Octave versions:
fid = tmpfile; fileinfo = stat(fid); datevec(strftime('%Y.%m.%e %k:%M:%S',localtime(fileinfo.mtime)),'yyyy.mm.dd HH:MM:SS') fclose(fid);
However, this seems even more overly complicated compared to the original version. Am I missing some easier solution?
- Installation method: Downloaded and installed octave-7.0.90-w64-installer.exe from https://alpha.gnu.org/gnu/octave/octave-7.0.90-w64-installer.exe