(parse): Parse price database entries using the fixed date format

"%Y/%m/%d %H:%M:%S".
This commit is contained in:
John Wiegley 2005-05-31 04:56:22 +00:00
parent bff42f702a
commit 7109c9234e

View file

@ -463,8 +463,12 @@ unsigned int textual_parser_t::parse(std::istream& in,
if (! p) break;
*p++ = '\0';
if (! quick_parse_date(b, &date))
struct std::tm when;
if (strptime(b, "%Y/%m/%d %H:%M:%S", &when)) {
date = std::mktime(&when);
} else {
throw parse_error(path, linenum, "Failed to parse date");
}
int hour, min, sec;