# CVDate
{: .no_toc }

Converts a valid date and time expression to a **Variant** of subtype **Date**.

Syntax: **CVDate(** *expression* **)**

*expression*
: *required* Any expression that can be converted to a date --- a date literal, a date/time string, or a number that falls within the range of acceptable dates.

The return type is **Variant** (**Date**). If *expression* is **Null**, **CVDate** returns **Null**.

**CVDate** is provided for compatibility with previous versions of Visual Basic. The syntax of **CVDate** is identical to [**CDate**](/tB/Modules/Conversion/CDate.md); however, **CVDate** returns a **Variant** whose subtype is **Date** instead of an actual **Date** type. Since **Date** is now an intrinsic type, there is no further need for **CVDate** in new code. The same effect can be achieved by converting an expression to a **Date** with [**CDate**](/tB/Modules/Conversion/CDate.md) and then assigning it to a **Variant**.

### Common Errors

| Error | When |
|---|---|
| [13 (`&HD`)](/Reference/Run-time-Errors.md#13), *Type mismatch* | *expression* is a string that is not a date, a time or a number (a zero-length string included), or a number outside the range of a **Date**: less than -657,434 (January 1, 100) or 2,958,466 (January 1, 10000) or more |

### Example

```tb check_build
Dim dateString As String
dateString = "February 28, 1998"
MsgBox "Date value of " & dateString & " is " & CVDate(dateString)
```

### See Also

- [CDate](/tB/Modules/Conversion/CDate.md), [CVar](/tB/Modules/Conversion/CVar.md), [CVErr](/tB/Modules/Conversion/CVErr.md) functions
