c# - Mongo UpdateDefinition render method change date to UTC -


this question has answer here:

i use method render of updatedefinition bsondocument code :

var updatebsondocument = updatedefinition.render(bsonserializer.lookupserializer<tdocument>(), bsonserializer.serializerregistry); 

when call method, datetime properties of object in updatedefinition serialized in bsondocument dates utc value.

how can prevent behavior ?

that default behavior mongodb, dates stored utc. according documentation, there's no way around this, other storing additional data need use original value back.

https://docs.mongodb.org/manual/tutorial/model-time-data/


Comments