Matlab's own datetime parsing logic uses try/catch in the happy path, which means you can't use dbstop if all error when parsing datetimes.
>> dbstop if all error
>> dt = datetime('2019-01-01 03:42')
Caught-error breakpoint was hit in @datetime/private/guessFormat>tryOneFmt at line 154. The error was:
Error using matlab.internal.datetime.createFromString
Unable to convert the text to datetime using the format 'dd-MMM-uuuu HH:mm:ss'.
154 t = createFromString(tryStr,fmt,2,tz,locale,pivot); % error, don't return NaT
K>> dbstack
> In guessFormat/tryOneFmt (line 154)
In guessFormat (line 43)
In datetime (line 632)
Write a replacement for datetime(str) that doesn't use try/catch. And then use that everywhere in Janklab's code.
Matlab's own
datetimeparsing logic uses try/catch in the happy path, which means you can't usedbstop if all errorwhen parsing datetimes.Write a replacement for
datetime(str)that doesn't use try/catch. And then use that everywhere in Janklab's code.