This commit is contained in:
2021-09-02 21:36:26 +02:00
parent a1b3b0140f
commit 427a3a9f04
7 changed files with 12 additions and 25 deletions

View File

@@ -19,8 +19,8 @@ std::string date_to_string(const long datetime, const std::string format) {
std::string result = {mbstr};
return result;
}
// TODO exception here
return "invalid argument";
throw std::runtime_error("date_to_string, invalid date string or format");
}
time_t time_to_epoch ( const struct tm *ltm, int utcdiff ) {
@@ -71,8 +71,7 @@ long string_to_date(const std::string &datestr, const std::string &format) {
return time_to_epoch(timeinfo, -1 * timeinfo->tm_gmtoff);
}
// throw Exception("invalid date string or format");
return -1;
throw std::runtime_error("string_to_date, invalid date string or format");
}