BitConverter: ToDate

ToDate

Converts an array of bytes to a Date value.



 Public Function ToDate(
	  ByRef Value ( ) As Byte,
	  ByVal StartIndex As Long ) As Date

Parameters

Value
[ByRef] Byte. The array of bytes to create a date from.
StartIndex
[ByVal] Long. The starting byte in the array to create a date from.

Return Values

Date -  Date datatype representation of the 8 bytes used in the array.

Remarks

The date type is stored as ticks in a 64-bit signed integer. The Visual Basic Date type cannot represent the entire range storable in 64-bits.

Exceptions

ExceptionCondition
ArgumentExceptionStartIndex is greater than or equal to the length of Value minus 7, and is less than or equal to the length of Value minus 1.
ArgumentNullExceptionValue is uninitialized.
ArgumentOutOfRangeExceptionStartIndex is less than zero or greater than the length of Value minus 1.
OverflowExceptionThe 64-bit value is outside the valid range of the Visual Basic Date type.

See Also

Project CorLib Overview

Class BitConverter Overview