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

DateTime serializes with one hour offset

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 2.9.3
    • Fix Version/s: None
    • Component/s: Bson, Serialization
    • Labels:
      None
    • Environment:
      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

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

              Dates

              Created:
              Updated:
              Resolved: