Closed jbfaden closed 3 months ago
What's going on is the routine which figures out the time was allowing 300 to be interpreted as a two-digit year. I've put in a check on the max of a two-digit year, to make sure it really is two digits.
However I can still get it to parse things which should not be parsed: dataset('2 20 2000 300'), and here there's a quick check to see if something is either European dates or American dates with a regex find. The find allows the USA date (M D Y) to be found, ignoring the trailing 300.
I've put in a check that no number can follow the USA or European date.
Codes which use the magnitude of numbers to guess their meaning should always be supervised by a human. So, it is fine to use these codes when interpreting the text entered in a GUI, but never in batch processing. Look out for use of dataset(string) when string is not carefully controlled.
I ran across a strange bug where a string is interpreted as a time. In Autoplot:
I followed this back to where this results in a time: dataset('2 20 300 2000'). Further, the string could be interpreted as "2:20 on day 300 of year 2000", but it's a much more obscure time. Clearly the logic for discovering times needs to be less permissive.