-
-
Notifications
You must be signed in to change notification settings - Fork 608
Description
Bug description
In Statamic v6, Date and Date Range fields behave unexpectedly and date values shift in time?
Maybe related to #13835 and #13837
How to reproduce
- Create a Date field in range mode, with time_enabled: false
- Set format: Y-m-d
- Open the Control Panel in a browser with timezone
Europe/Berlin - Enter a date range: 5 Feb 2026 – 6 Feb 2026
- Save the entry
Actual result
date_range_field:
start: '2026-02-04'
end: '2026-02-05'The Control Panel frontend also shows 4 Feb – 5 Feb after saving.
Expected result
date_range_field:
start: '2026-02-05'
end: '2026-02-06'Logs
Environment
Environment
Application Name: Statamic
Laravel Version: 12.50.0
PHP Version: 8.4.17
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
URL: statamic-6.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Storage
public/storage: NOT LINKED
Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.2.4 SoloInstallation
Fresh statamic/statamic site via CLI
Additional details
Even with time_enabled: false, Statamic internally treats range dates as DateTime values at 00:00 in the user’s local timezone, converts them to UTC, and then applies format: Y-m-d?
When the local timezone is ahead of UTC (e.g. Europe/Berlin), this results in:
2026-02-05 00:00 CET → 2026-02-04 23:00 UTC → formatted as 2026-02-04
But we can also reproduce this without the date_format. Seems to be related to browser time zone setting. If we override the sensor in Google Chrome and e.g. set it to Europe/London everything seems to be okay. Maybe we can totally ignore the users browser time zone setting?