YouTip LogoYouTip

Func Cdate

# VBScript CDate Function * * Complete VBScript Reference Manual](#) * * * The CDate function converts a valid date and time expression to a Date type and returns the result. **Tip:** Use the IsDate function to determine if a date can be converted to a date or time. **Note:** The IsDate function uses local settings to determine if a string can be converted to a date (in all languages, "January" is not a month). ### Syntax CDate(date) | Parameter | Description | | :--- | :--- | | date | Required. Any valid date expression (e.g., Date() or Now()). | * * * ## Examples ## Example 1 How to convert a string to a date: d=CDate("April 22, 2010") [Try it Β»](#) ## Example 2 How to convert a delimited number to a date: d=CDate(#4/22/10#) [Try it Β»](#) ## Example 3 How to use CDATE to convert a string to a time object: d=CDate("3:18:40 AM") [Try it Β»](#) * * Complete VBScript Reference Manual](#)
← Vb Func DateHtmldom Properties β†’