summaryrefslogtreecommitdiff
path: root/gnucash.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-28 05:24:02 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:32 -0400
commit5a93d4819e5fc753352618b729e0fe45532166b9 (patch)
tree200220bfcc5642a9efd8847001aeac889ed79e7d /gnucash.cc
parentc3c401ac0f43dfb3f71b818b45ef47578e6d390b (diff)
downloadfork-ledger-5a93d4819e5fc753352618b729e0fe45532166b9.tar.gz
fork-ledger-5a93d4819e5fc753352618b729e0fe45532166b9.tar.bz2
fork-ledger-5a93d4819e5fc753352618b729e0fe45532166b9.zip
Reworked the way date/times are handled.
Diffstat (limited to 'gnucash.cc')
-rw-r--r--gnucash.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gnucash.cc b/gnucash.cc
index 48250fbf..970fba3b 100644
--- a/gnucash.cc
+++ b/gnucash.cc
@@ -292,12 +292,9 @@ static void dataHandler(void *userData, const char *s, int len)
curr_entry->code = std::string(s, len);
break;
- case ENTRY_DATE: {
- struct tm when;
- strptime(std::string(s, len).c_str(), "%Y-%m-%d %H:%M:%S %z", &when);
- curr_entry->_date = std::mktime(&when);
+ case ENTRY_DATE:
+ curr_entry->_date = std::string(s, len);
break;
- }
case ENTRY_DESC:
curr_entry->payee = std::string(s, len);
@@ -375,6 +372,10 @@ unsigned int gnucash_parser_t::parse(std::istream& in,
{
char buf[BUFSIZ];
+ // This is the date format used by Gnucash, so override whatever the
+ // user specified.
+ date_t::input_format = "%Y-%m-%d %H:%M:%S %z";
+
count = 0;
action = NO_ACTION;
curr_journal = journal;