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

On this page
    AsDateTime Property
    On this page
    Gets or sets the value of the field as a DateTime. A BSON date and a TimeStamp are returned in the DateTimeKind of the document, a string is parsed, and a number is taken as a count of ticks. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as a BSON date; a value of the Unspecified kind is taken for the DateTimeKind of the document.
    Syntax
    'Declaration
     
    Public Property AsDateTime As Nullable(Of Date)
    public Nullable<DateTime> AsDateTime {get; set;}
    See Also