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

DateTimeSerializer with different Tick count when deserializing

    XMLWordPrintable

    Details

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

      Description

      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

       

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: