CDate

Date = CDate ( Expression AS Variant ) AS Date

Converts an expression (a number or a String) into a Date.

Be careful! The current localization is not used by this function.

In other words, if the expression is a string, it is assumed to be a date written in american format at UTC time.

Errors

Message Description
Type mismatch (6) Expression cannot be converted.

Examples

System.Language = "C"
Print CDate("09/06/1972 01:45:12")
09/06/1972 01:45:12

System.Language = "C"
Print CDate(2484515)
05/16/2002 00:00:00

See also