Skip to content

[Doctrine-Messenger] Datetime properties use UTC and not timezone of system -> documentation wrong / not updated #59405

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
Seesicht-IT opened this issue Jan 7, 2025 · 2 comments

Comments

@Seesicht-IT
Copy link

Seesicht-IT commented Jan 7, 2025

Symfony version(s) affected

6.4.16

Description

We just updated a Symfony project from 5.4 to 6.4 and realized that the datetime properties "created_at", "available_at" and "delivered_at" in the "messenger_messages" table are not the timezone of the system (which we set to Europe/Berlin), but are UTC.

We were searching for an error on our side, as the documentation clearly states:

The datetime property of the messages stored in the database uses the timezone of the current system. This may cause issues if multiple machines with different timezone configuration use the same storage.

Source: https://symfony.com/doc/6.4/messenger.html#doctrine-transport

In the end, we looked into the code and found that the behavior was changed in version 6.3 with this commit: symfony/doctrine-messenger@4236c40

Used versions:

  • Symfony Messenger: 6.4.16
  • Symfony Doctrine-Messenger: 6.4.13

How to reproduce

Just use the Symfony Messenger in version 6.3 and greater in combination with Doctrine-Messenger.

Possible Solution

Update the documentation to not be misleading anymore.

The datetime property of the messages stored in the database uses the UTC timezone.

Maybe also include that the behavior changed.

Additional Context

No response

@xabbuh
Copy link
Member

xabbuh commented Jan 8, 2025

see symfony/symfony-docs#20545

@Seesicht-IT
Copy link
Author

Mentioned pull request resolves the problem. Thanks @xabbuh !!

javiereguiluz added a commit to symfony/symfony-docs that referenced this issue Jan 8, 2025
This PR was merged into the 6.4 branch.

Discussion
----------

[Messenger] remove outdated timezone warning

this was changed in symfony/symfony#50287

fixes symfony/symfony#59405

Commits
-------

5e338ab remove outdated timezone warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants