Vbs Tutorial: function-cdate Function

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.