From 7109c9234e269cbf3667bb3fde9753936461b087 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 31 May 2005 04:56:22 +0000 Subject: (parse): Parse price database entries using the fixed date format "%Y/%m/%d %H:%M:%S". --- textual.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/textual.cc b/textual.cc index 1de6bd84..c1cba0b2 100644 --- a/textual.cc +++ b/textual.cc @@ -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; -- cgit v1.2.3