Description of the datediff function in VB

Source: Internet
Author: User
Tags date1

How to Use the datediff function in VB
Datediff (interval, date1, date2 [, firstweekofyear [, firstweekofyear])
Returns the value of variant (long), indicating the number of time intervals between two specified days.
Interval: Set the unit of Period Calculation between two dates. For example,>Interval= "M" indicates that the calculation unit is month. >IntervalSuch:
Yyyy> year
Q quarter
M month
D Day
W weekday
H hour
N minute points

S second seconds
Date1, date2: Two date expressions in the calculation period. If> date1 is earlier, the period result between two dates is positive. If> date2 is earlier, the result is negative.
Firstweekofyear: Set the first day of a week to the day of a week. If not set, it indicates Sunday. > The FW setting value is as follows:
0 usage> API setting value.
1 Sunday
2 Monday
3 Tuesday
4. Wednesday
Friday
6 Friday
7. Saturday
Firstweekofyear: Set the first week of the year. If not specified, the week of January 1, January 1 is the first week of the year. > The FY value is as follows:
0 usage> API setting value.
1. The week of January 1, January 1 is the first week of the year.
2. The first week of at least four days is the first week of a year.
3 contains the first week of seven days as the first week of a year
The proportions are as follows:
Calculate the number of months between two dates.
Diffmonthl = datediff ("M", date_start, date_end)


========================================================== ======================================

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.