go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Fix mongo's bson decoder timezone

Open Awadabang opened this issue 5 months ago • 0 comments

Is your feature request related to a problem? Please describe. When I upgrade gozero's version, all my *time.Time data query from mongodb changes to UTC. I found the reason that mongo-driver's version has upgraded, the bson decoder decodes *time.Time as UTC by default.

Describe the solution you'd like When we new a mongo collection, add a bsonOption called UseLocalTimeZone: true.

Awadabang avatar Sep 12 '24 07:09 Awadabang