Set MongoDB GMT Time in C#


Save DateTime as GMT time to mongo DB

You can set the UTC Date in property level and set when insert.

Property Attribute to save time as UTC

[BsonDateTimeOptions(Kind = DateTimeKind.Utc)] public DateTime UpdateDate { get; set; }

Save Date when Insert to MongoDatabase.

table.CreateDate = DateTime.UtcNow;


Reference about GMT