Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

QTP determines the number of days between two dates

Shulou Source: shulou.com Published: 2022-06-03 05:00:17 11月12日 Update

Determine the number of days between 2 dates:

Msgbox datediff ("d", "2014-6-30", date)

Syntax:

The DateDiff (interval,date1,date2 [, firstdayofweek [, firstweekofyear]]) parameter describes what is required for interval. The unit in which the interval between date1 and date2 is calculated.

The following values can be used:

Yyyy-year

Q-quarter

M-month

Y-Day of the year

D-day

W-the day of the week

Ww-week

H-hour

N-min

S-second date1,date2 required. Date expression. Two dates to be used in the calculation. Firstdayofweek is optional. Specify the number of days of the week, that is, the day of the week.

The following values can be used:

0 = vbUseSystemDayOfWeek-use Regional language support (NLS) API setting.

1 = vbSunday-Sunday (default)

2 = vbMonday-Monday

3 = vbTuesday-Tuesday

4 = vbWednesday-Wednesday

5 = vbThursday-Thursday

6 = vbFriday-Friday

7 = vbSaturday-Saturday firstweekofyear is optional. Stipulate the first week of the year.

The following values can be used:

0 = vbUseSystem-use Regional language support (NLS) API setting.

1 = vbFirstJan1-from the week in which January 1 is located (default).

2 = vbFirstFourDays-begins with the first week of at least four days in the New year.

3 = vbFirstFullWeek-starts with the first full week in the new year.

Tags: Week date face available between region language support two number of days unit parameter quarter hour rare location number of days time expression syntax Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia Microsoft Docker Redmi