Table of Contents

Class BsonDateTime

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON DateTime value.

public class BsonDateTime : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonDateTime>, IEquatable<BsonDateTime>
Inheritance
BsonDateTime
Implements
Inherited Members
Extension Methods

Constructors

BsonDateTime(DateTime)

Initializes a new instance of the BsonDateTime class.

BsonDateTime(long)

Initializes a new instance of the BsonDateTime class.

Properties

BsonType

Gets the BsonType of this BsonValue.

IsValidDateTime

Gets whether this BsonDateTime is a valid .NET DateTime.

MillisecondsSinceEpoch

Gets the number of milliseconds since the Unix Epoch.

Methods

CompareTo(BsonDateTime)

Compares this BsonDateTime to another BsonDateTime.

CompareTo(BsonValue)

Compares the BsonDateTime to another BsonValue.

Create(object)

Creates a new BsonDateTime.

Equals(BsonDateTime)

Compares this BsonDateTime to another BsonDateTime.

Equals(object)

Compares this BsonDateTime to another object.

GetHashCode()

Gets the hash code.

IConvertibleGetTypeCodeImplementation()

Implementation of the IConvertible GetTypeCode method.

IConvertibleToDateTimeImplementation(IFormatProvider)

Implementation of the IConvertible ToDateTime method.

ToLocalTime()

Converts this BsonValue to a DateTime in local time.

ToNullableLocalTime()

Converts this BsonValue to a DateTime? in local time.

ToNullableUniversalTime()

Converts this BsonValue to a DateTime? in UTC.

ToString()

Returns a string representation of the value.

ToUniversalTime()

Converts this BsonValue to a DateTime in UTC.

Operators

operator ==(BsonDateTime, BsonDateTime)

Compares two BsonDateTime values.

implicit operator BsonDateTime(DateTime)

Converts a DateTime to a BsonDateTime.

operator !=(BsonDateTime, BsonDateTime)

Compares two BsonDateTime values.