summaryrefslogtreecommitdiff
path: root/src/times.cc
diff options
context:
space:
mode:
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)