Skip to content

Fields persisted by Doctrine ORM Persister have a wrong timezone #3216

@souhail-5

Description

@souhail-5

API Platform version(s) affected: 2.5.0

Description
Hello,

Given I am using Doctrine ORM Persister
And I have an Entity property $occuredAt typed asdatetime
When I POST the field occuredAt with this value 2019-10-28T18:37:00+04:00
Then the Entity is wrongly persisted with this value 2019-10-28 18:37:00
And the Resource is wrongly returned with this value 2019-10-28T18:37:00+00:00

It should be persisted with this value 2019-10-28 14:37:00 returned with this value 2019-10-28T14:37:00+00:00 (if no extra serialization was applied).

Am I missing any configuration option?

Possible Solution
I tried to remove this line in ...\Bridge\Doctrine\Common\DataPersister and the returned value was as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions