diff options
-rw-r--r-- | src/times.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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; |