From 6096e80e36e486b9c0a75d0d9e1c1b978a7e7b55 Mon Sep 17 00:00:00 2001 From: mattgoud Date: Tue, 2 Jun 2026 14:32:12 +0200 Subject: [PATCH] Fix SQL queries using NOW() with MySQL timezone instead of shop timezone Replace NOW() in raw SQL queries with PHP's date() so that the shop's configured timezone is always used instead of the MySQL server timezone (UTC). Fixes PrestaShop/PrestaShop#30828 Co-Authored-By: Claude Sonnet 4.6 --- pagesnotfound.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pagesnotfound.php b/pagesnotfound.php index 5692a28..c369ada 100644 --- a/pagesnotfound.php +++ b/pagesnotfound.php @@ -200,7 +200,7 @@ public function hookDisplayTop($params) Db::getInstance()->execute( ' INSERT INTO `' . _DB_PREFIX_ . 'pagenotfound` (`request_uri`, `http_referer`, `date_add`, `id_shop`, `id_shop_group`) - VALUES (\'' . pSQL($request_uri) . '\', \'' . pSQL($http_referer) . '\', NOW(), ' . (int) $this->context->shop->id . ', ' . (int) $this->context->shop->id_shop_group . ') + VALUES (\'' . pSQL($request_uri) . '\', \'' . pSQL($http_referer) . '\', \'' . date('Y-m-d H:i:s') . '\', ' . (int) $this->context->shop->id . ', ' . (int) $this->context->shop->id_shop_group . ') ' ); }