CDate

Description

Returns Expression, this expression has been converted to a Date subtype of Variant.

syntax

cdate (date)

parameter

Description

Date

must be required. Any valid date expression. (, Such as Date () or now ())

Description

isdate function is used to determine if DATE can be converted to a date or time. CDATE identifies the date text and time text, as well as some numbers within the acceptable date range. When the digital is converted into a date, the number of integers of the numbers is converted to the date, and the score portion is converted to the time calculated from midnight.

CDate

cdate is set to identify the date format according to the area of ​​the system. If the format of the data cannot be identified by the date setting, the correct order of the year, month, and day cannot be judged. In addition, if the long date format contains a string representing the day of the week, it cannot be identified.

Example

Example 1

d = "April 22, 2001" if isdate (d) The Document.write (CDATE (D)) endiff output :

4/22/01

Example 2

d = # 2/22/01 # if isdate (d) Then Document.write (CDATE d)) End IF output:

2/22/01

Example 3

d = "3:18:40 am" if isdate (d) Then Document.write (CDATE (D)) end if output:

3:18:40 AM

Related Articles
TOP