C#驱动环境
mongodb默认会把时间类型转换为0时区,如果需要输出为本地时区,只需在实体属性上加一个Attribute即可,例如:
c#
[MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = DateTimeKind.Local)]
public DateTime CreateTime { get; set; }C#驱动环境
mongodb默认会把时间类型转换为0时区,如果需要输出为本地时区,只需在实体属性上加一个Attribute即可,例如:
c#
[MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = DateTimeKind.Local)]
public DateTime CreateTime { get; set; }