From 8f687c604271aaa5917ea686ccf07dbd47def410 Mon Sep 17 00:00:00 2001 From: Pavel Kartavyy Date: Tue, 28 Oct 2014 20:55:07 +0300 Subject: [PATCH] RecountRequest: fixed wrong formatting, when chunk is empty [#METR-13437] --- libs/libmysqlxx/include/mysqlxx/DateTime.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/libmysqlxx/include/mysqlxx/DateTime.h b/libs/libmysqlxx/include/mysqlxx/DateTime.h index 8429d2256a8..46dccd3c38b 100644 --- a/libs/libmysqlxx/include/mysqlxx/DateTime.h +++ b/libs/libmysqlxx/include/mysqlxx/DateTime.h @@ -4,6 +4,7 @@ #include #include +#include namespace mysqlxx @@ -177,12 +178,15 @@ public: inline std::ostream & operator<< (std::ostream & ostr, const DateTime & datetime) { - return ostr << datetime.year() - << '-' << (datetime.month() / 10) << (datetime.month() % 10) + ostr << std::setfill('0') << std::setw(4) << datetime.year(); + + ostr << '-' << (datetime.month() / 10) << (datetime.month() % 10) << '-' << (datetime.day() / 10) << (datetime.day() % 10) << ' ' << (datetime.hour() / 10) << (datetime.hour() % 10) << ':' << (datetime.minute() / 10) << (datetime.minute() % 10) << ':' << (datetime.second() / 10) << (datetime.second() % 10); + + return ostr; } }