Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2871

DateTime serializes with one hour offset

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.9.3
    • Component/s: BSON, Serialization
    • None
    • Environment:
      Win10, Local MongoDB server

      I have a DateTime property in my class which is set to a date but no time, e.g. Dec 7, 1980 0:00:00.

      {{public DateTime DateOfBirth { get; set; }}}

      The property is auto serialized (no bson attributes or whatever) and the expected value in the collection is:

      1980-12-07T00:00:00.000+00:00

      However what is written to the database instead is:

      1980-12-06T23:00:00.000+00:00

       

            Assignee:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Reporter:
            skharchi@xion-medical.com Samir Kharchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: