summaryrefslogtreecommitdiff
path: root/parse.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-06-21 04:52:43 -0400
committerjohnw <johnw@newartisans.com>2004-06-21 04:52:43 -0400
commitc892e8c7ad0aaf6c47ff6e9075149a76188ae670 (patch)
treec21e7f6145722e430439b00785ebe63f609823bd /parse.cc
parent39ee2ae3d846b4bffa4e42ba4f3a9bc320ca9270 (diff)
downloadfork-ledger-c892e8c7ad0aaf6c47ff6e9075149a76188ae670.tar.gz
fork-ledger-c892e8c7ad0aaf6c47ff6e9075149a76188ae670.tar.bz2
fork-ledger-c892e8c7ad0aaf6c47ff6e9075149a76188ae670.zip
fixes to price history support
Diffstat (limited to 'parse.cc')
-rw-r--r--parse.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/parse.cc b/parse.cc
index 938983e0..e4850973 100644
--- a/parse.cc
+++ b/parse.cc
@@ -420,7 +420,7 @@ int parse_ledger(book * ledger, std::istream& in,
case 'P': { // a pricing entry
in >> c;
- time_t date;
+ std::time_t date;
std::string symbol;
in >> line; // the date
@@ -429,6 +429,16 @@ int parse_ledger(book * ledger, std::istream& in,
<< ": Failed to parse date: " << line << std::endl;
break;
}
+
+ int hour, min, sec;
+ in >> hour; // the time
+ in >> c;
+ in >> min;
+ in >> c;
+ in >> sec;
+ date = std::time_t(((unsigned long) date) +
+ hour * 3600 + min * 60 + sec);
+
in >> symbol; // the commodity
in >> line; // the price