summaryrefslogtreecommitdiff
path: root/src/times.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-19 15:50:24 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-19 15:50:24 -0400
commit3826cb1beee5abb46502c11cd69e7e493ad4f4ae (patch)
tree1438bf87907250a5108b784700f40b67627cf69d /src/times.cc
parentc7cffa36ad963ea8a70c522ae9f3d93037711979 (diff)
downloadfork-ledger-3826cb1beee5abb46502c11cd69e7e493ad4f4ae.tar.gz
fork-ledger-3826cb1beee5abb46502c11cd69e7e493ad4f4ae.tar.bz2
fork-ledger-3826cb1beee5abb46502c11cd69e7e493ad4f4ae.zip
Re-enabled parsing of timelog data
Diffstat (limited to 'src/times.cc')
-rw-r--r--src/times.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/times.cc b/src/times.cc
index 7101d3c6..df760d10 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -106,12 +106,14 @@ namespace {
}
}
-datetime_t parse_datetime(const char * str, int current_year)
+datetime_t parse_datetime(const char * str, int)
{
std::tm when;
- // jww (2008-08-01): Needs to look for HH:MM:SS as well.
- quick_parse_date(str, when, current_year);
- return posix_time::ptime_from_tm(when);
+ std::memset(&when, -1, sizeof(std::tm));
+ if (strptime(str, "%Y/%m/%d %H:%M:%S", &when))
+ return posix_time::ptime_from_tm(when);
+ else
+ return datetime_t();
}
date_t parse_date(const char * str, int current_year)