C# driver assumes the DateTime is of kind Local when it's Unspecified

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.10.2
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

       

      // the date is of kind Unspecified
      var date = DateTime.Parse("2020-11-20"); 
      
      // the filter will render as if the date was of kind Local
      var filter = Builders<BsonDocument>.Filter.Eq(it => it.Created, date); 

       
      Seems logical to assume the date is of kind Utc in case it is not provided.

              Assignee:
              Robert Stam
              Reporter:
              Diana Zhivkova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: