Promotion start_date does not use store timezone on creation

Created on 10 January 2024, 12 months ago
Updated 19 January 2024, 11 months ago

The getDefaultStartDate function in the Promotion class creates a formatted date string using the user's current timezone, rather than the datetime in the timezone of the store. That means that if promotions are created programatically without explicitly specifying the start date, the start date will only have the proper value if the user has the same timezone set as the store. If not, the resulting time string will be wrong, and may lead to hours-long delays before the promotion becomes active.

Similarly, when creating a promotion using the front-end create promotion form, the date time being entered into the database is in the user's timezone rather than the store timezone, so promotions do not start working at the time that the user has specified.

🐛 Bug report
Status

Closed: works as designed

Version

3.0

Component

Promotions

Created by

🇺🇸United States mikemccaffrey

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024