MongoDB.Bson.IO.BsonBinaryWriter.WriteDateTime C# (CSharp) Method

WriteDateTime() public method

Writes a BSON DateTime to the writer.
public WriteDateTime ( long value ) : void
value long The number of milliseconds since the Unix epoch.
return void
        public override void WriteDateTime(long value)
        {
            if (Disposed) { throw new ObjectDisposedException("BsonBinaryWriter"); }
            if (State != BsonWriterState.Value)
            {
                ThrowInvalidState("WriteDateTime", BsonWriterState.Value);
            }

            _buffer.WriteByte((byte)BsonType.DateTime);
            WriteNameHelper();
            _buffer.WriteInt64(value);

            State = GetNextState();
        }