Search notes:

VBA: cDate / cvDate

function cDate (expr as variant) as date
function cvDate(expr as variant) as variant
cDate(dt) and cvDate(dt) are conversion functions: they both convert dt to a date.
The difference between these functions is that cDate returns a date and cvDate returns a variant. Thus, the expression cvDate(null) is valid while cDate(null) raises run-time error 94: Invalid use of Null.
If dt is a numeric type, it is interpreted (cast) as double which represents (fractional) days since midnight 1899-12-30 (See here).
If dt it is a string, it is tried to be interpreted according to the locale currently in effect (which is not always possible).

See also

Other VBA functions

Index