VBS Tutorial: function-TimeSerial Function

Source: Internet
Author: User

TimeSerial Function

ReturnsDateChild typeVariant, Including the time of the timer, minute, and second.

TimeSerial (Hour, minute, second)

Parameters

Hour

The value is A numeric or numeric expression from 0 (a.m.) to 23 (p.m.

Minute

Any numeric expression.

Second

Any numeric expression.

Description

To specify a time point, such as 11:59:59,TimeSerialThe value of the parameter should be within the acceptable range; that is, the hour should be between 0-23, and the minute and second should be between 0-59. However, you can use a numeric expression to specify the relative time for each parameter. This expression represents the time, minute, or second before or after a time.

The following example uses the expression of absolute time.TimeSerialThe function returns the 15 minutes (-15) before the first six (12-6) hours, or 5:45:00 A.M.

Dim MyTime1MyTime1 =TimeSerial (12-6,-15,0)'Return5:45:00 AM.

When the value of any parameter exceeds the acceptable range, it is correctly carried to the next large time unit. For example, if 75 minutes are specified, the time is interpreted as one hour and 15 minutes. However, if any parameter value exceeds the range of-32768 to 32767, an error occurs. If the time specified by the three parameters or the time calculated by the expression exceeds the acceptable date range, an error occurs.

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.