From 470730c92dc62377bcf455c08a818888e84ece67 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 20 Jun 2010 18:37:14 -0400 Subject: --input-date-format now affects dates with times --- src/times.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/times.cc') diff --git a/src/times.cc b/src/times.cc index 31367e34..72e26b91 100644 --- a/src/times.cc +++ b/src/times.cc @@ -310,7 +310,14 @@ string_to_month_of_year(const std::string& str) datetime_t parse_datetime(const char * str) { - datetime_t when = input_datetime_io->parse(str); + char buf[128]; + std::strcpy(buf, str); + + for (char * p = buf; *p; p++) + if (*p == '.' || *p == '-') + *p = '/'; + + datetime_t when = input_datetime_io->parse(buf); if (when.is_not_a_date_time()) throw_(date_error, _("Invalid date/time: %1") << str); return when; -- cgit v1.2.3