diff options
author | John Wiegley <johnw@newartisans.com> | 2005-05-31 04:56:22 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:11 -0400 |
commit | 7109c9234e269cbf3667bb3fde9753936461b087 (patch) | |
tree | ef27d09d3ec76d3288d8028cc61cff6293a432d1 | |
parent | bff42f702accee3ec4b53b1efd254cf3c1237214 (diff) | |
download | fork-ledger-7109c9234e269cbf3667bb3fde9753936461b087.tar.gz fork-ledger-7109c9234e269cbf3667bb3fde9753936461b087.tar.bz2 fork-ledger-7109c9234e269cbf3667bb3fde9753936461b087.zip |
(parse): Parse price database entries using the fixed date format
"%Y/%m/%d %H:%M:%S".
-rw-r--r-- | textual.cc | 6 |
1 files changed, 5 insertions, 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; |