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

Replace AsDateTime with ToLocalTime and ToUniversalTime in BsonValue (and related changes)

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.8
    • 1.7
    • None
    • None

    Description

      Most of the AsXyz properties in BsonValue are simple casts that don't do any real conversion between types. But the AsDateTime and related properties actually do a type conversion because BsonDateTime and DateTime have different ranges and resolutions, as well the question of whether to convert to local or universal time.

      The following changes will be made:

      Deprecate AsDateTime: use ToLocalTime or ToUniversalTime instead
      Deprecate AsNullableDateTime: use ToNullableLocalTime or ToNullableUniversalTime instead
      Deprecate AsUniversalTime: use ToUniversalTime instead
      Deprecate IsDateTime: use IsValidDateTime instead (aligns with property of the same name in BsonDateTime)

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: