Table of Contents

Class BsonUtils

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

A static class containing BSON utility methods.

public static class BsonUtils
Inheritance
BsonUtils
Inherited Members

Methods

GetFriendlyTypeName(Type)

Gets a friendly class name suitable for use in error messages.

ParseHexString(string)

Parses a hex string into its equivalent byte array.

ToDateTimeFromMillisecondsSinceEpoch(long)

Converts from number of milliseconds since Unix epoch to DateTime.

ToHexChar(int)

Converts a value to a hex character.

ToHexString(byte[])

Converts a byte array to a hex string.

ToLocalTime(DateTime)

Converts a DateTime to local time (with special handling for MinValue and MaxValue).

ToMillisecondsSinceEpoch(DateTime)

Converts a DateTime to number of milliseconds since Unix epoch.

ToSecondsSinceEpoch(DateTime)

Converts a DateTime to number of seconds since Unix epoch.

ToUniversalTime(DateTime)

Converts a DateTime to UTC (with special handling for MinValue and MaxValue).

TryParseHexString(string, out byte[])

Tries to parse a hex string to a byte array.