The VBScript CDate Function is used to convert a valid date and time expression to type Date. It returns the correct order of dates. It recognizes date formats according to the locale setting of your system.
Note: We can also use the IsDate function to determine if date can be converted to a date or time.
Parameter: This function accepts a single a parameter as mentioned above and described below.
- date: It is a required attribute. It specify any valid date expression.
Example 1: Below examples illustrates the VBScript CDate Function.
Example 2: Below code illustrates that how to convert numbers with separators to a date: