Returns the expression converted to a date variant-subtype (Variant).

expressionThe expression to evaluate and convert to a date.

* You should use the CDATE function instead.
* When converting a number to a date, the whole number portion is converted to the date, and any fractional part of the number is converted to the time.
* This function will convert any number of data types and string formats into an actual date.
* This function is provided for backwards compatibility and should not be used.
* For more information, refer to the Data Types > Date-Variant page.

Dim vDate As Variant 
vDate = CVDate("11/2/97")
Debug.Print TypeName(vDate)

Dim dtDate As Date
dtDate = CVDate("November 2, 1997")
Debug.Print TypeName(dtDate)

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top