Skip to content

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

Closed
@Seesicht-IT

Description

@Seesicht-IT

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions