Cdate Function
Return expression, which has been convertedDateChild typeVariant.
Cdate (Date)
DateThe parameter is any valid date expression.
Description
IsdateFunction used to judgeDateWhether it can be converted to date or time.CdateRecognize date text and time text, and some numbers within the acceptable date range. When a number is converted to a date, the integer part of the number is converted to a date, and the score part is converted to the time calculated from midnight.
CdateRecognize date formats based on system region settings. If the data format cannot be identified by the date setting, the correct order of year, month, and day cannot be determined. In addition, if the long date format contains a string representing the day of the week, it cannot be recognized.
The following example usesCdateThe function converts a string to a date type. Hardware decoding date and time are generally not recommended as strings (as shown in the following example ). Use the time and date text (for example, #10/19/1962 #, #4:45:23 #).
Mydate = "October 19,196 2"
'
Defines the date.My1_date =Cdate (Mydate)
'
Convert to date data type.Mytime = "4:35:47"
'
Defines the time.Mydomaintime =Cdate (Mytime)
'
Convert to date data type.