(parse): Parse price database entries using the fixed date format
"%Y/%m/%d %H:%M:%S".
This commit is contained in:
parent
bff42f702a
commit
7109c9234e
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue