BinaryReader: ReadDate

ReadDate

Reads eight bytes from the stream and returns them as a Date type.



 Public Function ReadDate ( ) As Date

Return Values

Date -  A Date type read from the stream.

Remarks

A Visual Basic Date type is represented as a Double type. However, this method reads in a 64 bit integer value as the Ticks of a CorDateTime type and converts it to Date.

If there is a need to read in a standard Date represeted as Double use the ReadDouble method.

Exceptions

Exception Condition
EndOfStreamExceptionThe end of the stream is reached.
ObjectDisposedExceptionThe stream is closed.
IOExceptionAn I/O error occurs.
OverflowExceptionThe sequence of eight bytes represented an invalid date.

See Also

Project CorLib Overview

Class BinaryReader Overview

ReadDouble