Library saving dates ignoring timezone application
- Laravel-mongodb Version: #.#.#
- PHP Version: 7.4.27
- Database Driver & Version: 1.12.0
Description:
Steps to reproduce
- set date_default_timezone_set("America/Sao_Paulo")
- record in database one register with datetime
- check record registred timezone america +3 not America/Sao_Paulo
Expected behaviour
Record registred with timezone configured from system
Actual behaviour
Record registred with timezone diferente from timezone configured from system
Logs:
Insert log.txt here (if necessary)
@ceresaconsultoria Dates in MongDB are always stored in UTC. When you set the timezone to America/Sao_Paulo, it will be converted to UTC before the record is saved. For instance, if you store a record with date 2022-05-10 16:28:00 ( America/Sao_Paulo -03:00), the date stored in database will be 2022-05-10 19:28:00 (UTC +00:00)
Hi
thanks for response.
Atenciosamente,
Em ter., 10 de mai. de 2022 às 16:33, joaovitoralvares < @.***> escreveu:
@ceresaconsultoria https://github.com/ceresaconsultoria Dates in MongDB are always stored in UTC. When you set the timezone to America/Sao_Paulo, it will be converted to UTC before the record is saved. For instance, if you store a record with date 2022-05-10 16:28:00 ( America/Sao_Paulo -03:00), the date stored in database will be 2022-05-10 19:28:00 (UTC +00:00)
— Reply to this email directly, view it on GitHub https://github.com/jenssegers/laravel-mongodb/issues/2338#issuecomment-1122784318, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANMHJ2FAQUZKGIKDNFJIA23VJK2X5ANCNFSM5MYHUFFQ . You are receiving this because you were mentioned.Message ID: @.***>