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

Add DateTime representation to DateTimeOffsetSerializer

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.15.0
    • Affects Version/s: 2.7.2
    • Component/s: Serialization
    • None
    • Fully Compatible

      Hi all,

      I was wondering why the decision was made to not allow a BsonType.DateTime to be (de)serialized as DateTimeOffset? I know you loose the Offset, etc. but I think this is not a big deal. Converting DateTimeOffset to and from DateTimes is generally a valid operation, so why not allowing it in MongoDB C#?

      Just curios, because it could help, when someone has to handle with DateTimeOffset in models but wants to be persisted as BsonType.DateTime.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            lukster Lukas Vosyka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: