Skip to content

[5.x]: Date field precission issue with dates far back in the past in Europe/Amsterdam timezone #16953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JeroenJRP opened this issue Mar 25, 2025 · 3 comments
Assignees
Labels

Comments

@JeroenJRP
Copy link
Contributor

What happened?

Description

When using the Date field and saving a date far in the past when using the Europe/Amsterdam timezone the date is set 1 day back.

Steps to reproduce

  1. Set system timezone to Europe/Amsterdam
  2. Add a custom Date field to an Entry Type
  3. Save entry with date field value set to e.g. 07-01-1881

Expected behavior

Value stays at 07-01-1881

Actual behavior

Value is set to 06-01-1881

When reading the value in twig with {{ item.dateField|date("Y-m-d H:i:s e") }} the displayed value is 1881-01-06 23:57:58 Europe/Amsterdam

Craft CMS version

5.6.13

PHP version

8.3.14

Operating system and version

Linux 5.15.167.4-microsoft-standard-WSL2

Database type and version

MariaDB 10.6.18

Image driver and version

No response

Installed plugins and versions

No response

@i-just
Copy link
Contributor

i-just commented Mar 26, 2025

Hi, thanks for reporting! I raised a PR for this, and it has details on why this is happening.

@JeroenJRP
Copy link
Contributor Author

Thank you!

@brandonkelly
Copy link
Member

Craft 4.14.12 and 5.6.14 are out with that fix. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants