diff options
Diffstat (limited to 'src/times.h')
-rw-r--r-- | src/times.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/times.h b/src/times.h index 6abd2109..a7f905e6 100644 --- a/src/times.h +++ b/src/times.h @@ -89,10 +89,11 @@ inline string format_datetime(const datetime_t& when) inline string format_date(const date_t& when, const optional<string>& format = none) { - if (format) { + if (format || ! output_date_format.empty()) { char buf[256]; std::tm moment = gregorian::to_tm(when); - std::strftime(buf, 255, format->c_str(), &moment); + std::strftime(buf, 255, format ? + format->c_str() : output_date_format.c_str(), &moment); return buf; } else { return to_simple_string(when).substr(2); |