Poco::DateTimeParser::tryParse issue
Hi all, if you use DateTimeParser::tryParse to parse an invalida datetime, often you obtain true but the datetime is invalid
Poco::DateTime dt;
int tz = 0;
if (Poco::DateTimeParser::tryParse("%d/%m/%Y", "some invalid date time", dt, tz)) {
//you obtain true but with dt with a negative value
}
Quote from the document: " All parsing methods do their best to parse a meaningful result, even from malformed input strings. I guess that's why that function doesn't check the input strictly and it is an expected behavior.
The parsing code in DateTimeParser could use some improvement. For example, currently it basically ignores all non-format characters in the format string. Also, some better range checking may be in order. See also #569
This issue is stale because it has been open for 365 days with no activity.
#569