Skip to content

Fix: SQL queries using NOW() rely on MySQL timezone instead of shop timezone#30

Closed
mattgoud wants to merge 1 commit into
PrestaShop:devfrom
mattgoud:fix-30828-replace-sql-now-with-php-date
Closed

Fix: SQL queries using NOW() rely on MySQL timezone instead of shop timezone#30
mattgoud wants to merge 1 commit into
PrestaShop:devfrom
mattgoud:fix-30828-replace-sql-now-with-php-date

Conversation

@mattgoud

@mattgoud mattgoud commented Jun 2, 2026

Copy link
Copy Markdown
Contributor
Questions Answers
Branch? dev
Description? The search stats INSERT used `NOW()` to store `date_add`, which relies on the MySQL server timezone (UTC by default). Replaced with PHP's `date('Y-m-d H:i:s')` so the shop's configured timezone is used.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed issue or discussion? Related to PrestaShop/PrestaShop#30828
Related PRs PrestaShop/PrestaShop#41596
Sponsor company PrestaShop SA

Related CI issue: #31

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 <noreply@anthropic.com>
@ps-jarvis

Copy link
Copy Markdown

Hello @mattgoud!

This is your first pull request on statssearch repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@mattgoud

mattgoud commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Closed. Alternative solution proposed by the PR PrestaShop/PrestaShop#41628 (nb: targets the develop branch only)

@mattgoud mattgoud closed this Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Closed in PR Dashboard Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants