dotConnect for MongoDB Documentation
Devart.Data.MongoDB Namespace / MongoDBField Class / AsDateTimeOffset Property

On this page
    AsDateTimeOffset Property
    On this page
    Gets or sets the value of the field as a DateTimeOffset. A BSON date gets the offset of the DateTimeKind of the document, a value in the form of the DateTimeOffsetFormat of the document is read as is, and a string is parsed. Returns a null reference (Nothing in Visual Basic) for a missing field or a BSON a null reference (Nothing in Visual Basic); throws System.InvalidOperationException for the other types. The value is written in the DateTimeOffsetFormat of the document; with MongoDBDateTimeOffsetFormat.DateTime it is stored as a BSON date in UTC without the offset.
    Syntax
    'Declaration
     
    Public Property AsDateTimeOffset As Nullable(Of DateTimeOffset)
    public Nullable<DateTimeOffset> AsDateTimeOffset {get; set;}
    See Also