[icinga-checkins] icinga.org: icinga2/master: Ensure that PostgreSQL timestamps are UTC

git at icinga.org git at icinga.org
Wed Jan 11 17:35:12 CET 2017


Module: icinga2
Branch: master
Commit: e9db716b26e49a36d733d5e224280fb63943fb9f
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=e9db716b26e49a36d733d5e224280fb63943fb9f

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Wed Jan 11 17:34:09 2017 +0100

Ensure that PostgreSQL timestamps are UTC

fixes #13617

---

 lib/db_ido_pgsql/idopgsqlconnection.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp
index f398fda..c16f9f5 100644
--- a/lib/db_ido_pgsql/idopgsqlconnection.cpp
+++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp
@@ -636,7 +636,7 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
 	} else if (DbValue::IsTimestamp(value)) {
 		long ts = rawvalue;
 		std::ostringstream msgbuf;
-		msgbuf << "TO_TIMESTAMP(" << ts << ")";
+		msgbuf << "TO_TIMESTAMP(" << ts << ") AT TIME ZONE 'UTC'";
 		*result = Value(msgbuf.str());
 	} else if (DbValue::IsTimestampNow(value)) {
 		*result = "NOW()";



More information about the icinga-checkins mailing list