summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-05-31 04:56:22 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:11 -0400
commit7109c9234e269cbf3667bb3fde9753936461b087 (patch)
treeef27d09d3ec76d3288d8028cc61cff6293a432d1
parentbff42f702accee3ec4b53b1efd254cf3c1237214 (diff)
downloadfork-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.cc6
1 files changed, 5 insertions, 1 deletions
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;