Skip to content

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

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#451
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
Questions Answers
Branch? dev
Description? `WishList::refreshWishList()` used `UNIX_TIMESTAMP(NOW())` to compute the age of wishlist carts, which relies on the MySQL server timezone. Replaced with PHP's `time()` which always returns a UTC Unix timestamp independent of MySQL's timezone setting.
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

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 blockwishlist repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@mattgoud

mattgoud commented Jun 5, 2026

Copy link
Copy Markdown
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