Version

DateTimeFromObject Method

Creates and returns a DateTime from the given object, if possible.
Syntax
'Declaration
 
Public Shared Function DateTimeFromObject( _
   ByVal timeObject As Object _
) As Date
public static DateTime DateTimeFromObject( 
   object timeObject
)

Parameters

timeObject
The object to return as a DateTime.

Return Value

If the given object is a DateTime or can be parsed as a DateTime, the appropriate DateTime is returned. Otherwise, DateTime.MinValue is returned.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also