Today I ran into trouble with datenum('2021-07-21 09:00:00.987'). The fractional part. But what I soon found is that this: datenum('2021-07-21 09:00:00.987','yyyy-mm-dd HH:MM:SS.FFF') works just fine. (This is of course a primary use case of those who would analyze SQL data.)
...
Looking at datevec.m, none of the std_formats have FFF, so likely enhancing the search (though it works on Matlab) makes no sense. Does it?
Generally there is resistance to trying to emulate 'undocumented matlab'. the matlab docs dont specify any predefined formats including FFF. But, it does provide for automatic recognition of the FFF string. So it appears that Matlab's autorecognition does understand the format, despite the datevec text saying: " If you do not specify formatIn
, then DateString
must be in one of the following formats..." (none of which include FFF)
I don't think people would want to mess with the pre-defined formats, since they're a compatibility item. There could be an argument made expanding the autorecognition, though.