alcaeus / mongo-php-adapter

:link: Adapter to provide ext-mongo interface on top of mongo-php-library
MIT License
463 stars 124 forks source link

MongoDate conversion to DateTime fails in ambiguous edge case #273

Closed carlos-granados closed 3 years ago

carlos-granados commented 3 years ago

MongoDate conversion to DateTime produces the wrong result during very specific cases due to DST time changes. For example, see this case:

This would be fixed if we inverted the process so that we first set the timezone of the newly created object to UTC and then set the timestamp

alcaeus commented 3 years ago

Thanks for the report. Fixing in #274, which also uses the exact same timestamp that you used in your tests. I'll release a fix once the build is stable.