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

DateTimeSerializer with different Tick count when deserializing

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.10.2
    • Component/s: Serialization
    • Labels:
      None
    • Environment:
      Win10

      Using the DateTimeSerializer the tick count differs when deserializing a DateTime object:

      DateTimeSerializer.LocalInstance.Serialize(context, args, aDateTime);
      var decodedDateTime = DateTimeSerializer.LocalInstance.Deserialize(context, args);

      The deserialized DateTime object is equal to the original except for the Tick count which differs by some nanoseconds (this is reproducable and it's always the last 4 digits of the tick count that differ). Here is one Xunit exception message:

      Xunit.Sdk.EqualException: "Assert.Equal() Failure
      Expected: 2020-03-06T09:54:09.6356673+01:00
      Actual:     2020-03-06T09:54:09.6350000+01:00

       

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            skharchi@xion-medical.com Samir Kharchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: