VOOZH about

URL: https://www.geeksforgeeks.org/web-tech/vbscript-cdate-function/

⇱ VBScript CDate() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

VBScript CDate() Function

Last Updated : 20 Oct, 2021

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.

Syntax:

CDate(date)

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.

Output:

5/6/2020

Example 2: Below code illustrates that how to convert numbers with separators to a date:

Output:

4/22/2010
Comment