CDate function
CVDate( expression )
Converts any valid expression to a Date variable with a vartype of 7.
The parameter expression must be a valid string or numeric date expression and can represent a date from January 1, 30 through December 31, 9999.
Example
Sub Main
   Dim MyDate, MDate, MTime, MSTime
   MybDate = "May 29, 1959"   ' Define date.
   MDate = CDate(MybDate)   ' Convert to Date data type.
 
   MTime = "10:32:27 PM"   ' Define time.
   MSTime = CDate(MTime)   ' Convert to Date data type.
 
   Print MDate
   Print MSTime
End Sub