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

DateTime serializes with one hour offset

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 2.9.3
    • BSON, Serialization
    • None
    • Win10, Local MongoDB server

    Description

      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

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: