Sylius: Model's datetime properties have no support for timezones handling

Created on 21 Jul 2017  路  1Comment  路  Source: Sylius/Sylius

We use datetime Doctrine type everywhere so if we set a date 2017-07-21T12:30:00+02:30, flush and get that object again we will get a different time 2017-07-21T12:30:00+00:00 (resetted timezone, not adjusted time). Is there anything stopping us from using datetimetz field type?

RFC

Most helpful comment

The other way to go about it, and the way I work in my Symfony apps, is to use a UTCDateTimeType field (based on one of the Doctrine docs pages) so that the timestamps are consistently stored in UTC and I can handle timezone conversions as needed.

>All comments

The other way to go about it, and the way I work in my Symfony apps, is to use a UTCDateTimeType field (based on one of the Doctrine docs pages) so that the timestamps are consistently stored in UTC and I can handle timezone conversions as needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loic425 picture loic425  路  3Comments

igormukhingmailcom picture igormukhingmailcom  路  3Comments

tchapi picture tchapi  路  3Comments

xleliberty picture xleliberty  路  3Comments

ping86 picture ping86  路  3Comments