Ensure that PostgreSQL timestamps are UTC

fixes #13617
This commit is contained in:
Michael Friedrich 2017-01-11 17:34:09 +01:00
parent b51a2c1c25
commit e9db716b26

View File

@ -636,7 +636,7 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
} else if (DbValue::IsTimestamp(value)) { } else if (DbValue::IsTimestamp(value)) {
long ts = rawvalue; long ts = rawvalue;
std::ostringstream msgbuf; std::ostringstream msgbuf;
msgbuf << "TO_TIMESTAMP(" << ts << ")"; msgbuf << "TO_TIMESTAMP(" << ts << ") AT TIME ZONE 'UTC'";
*result = Value(msgbuf.str()); *result = Value(msgbuf.str());
} else if (DbValue::IsTimestampNow(value)) { } else if (DbValue::IsTimestampNow(value)) {
*result = "NOW()"; *result = "NOW()";