diff --git a/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php b/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
index c919fadb671f6e6885703ab9aeb9d71e7c7a4558..60b1f298bdc63a31aa79b9969df4cabaa68ebf1c 100644
--- a/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
+++ b/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
@@ -66,7 +66,7 @@ public function __construct(Connection $database) {
   public function getDateField($field, $string_date) {
     if ($string_date) {
       // Ensures compatibility with field offset operation below.
-      return "TO_TIMESTAMP($field, 'YYYY-MM-DD HH24:MI:SS')";
+      return "TO_TIMESTAMP($field, 'YYYY-MM-DD\"T\"HH24:MI:SS')";
     }
     return "TO_TIMESTAMP($field)";
   }
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php b/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php
index 4bef1efb5cb9d6ed344c9f8a4930bfe7295ce93e..2ea1f72fcae4e5b47f1c6d19fb63ec213e0aa04a 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php
@@ -38,7 +38,7 @@ public function setUp(): void {
   public function testGetDateField() {
     $date_sql = new PostgresqlDateSql($this->database);
 
-    $expected = "TO_TIMESTAMP(foo.field, 'YYYY-MM-DD HH24:MI:SS')";
+    $expected = "TO_TIMESTAMP(foo.field, 'YYYY-MM-DD\"T\"HH24:MI:SS')";
     $this->assertEquals($expected, $date_sql->getDateField('foo.field', TRUE));
 
     $expected = 'TO_TIMESTAMP(foo.field)';