Returns a long integer value specifying the number of time intervals between two specified dates.
Syntax:
MathLibObject.DateTimeDiff(Interval As String, dtDate1 As Date, dtDate2 As Date)
The DateTimeDiff Method (MathLib Object) syntax has these parts:
| Part |
Description |
| MathLibObject |
An object expression that evaluates to a MathLib object. |
| Interval |
Required. String expression that is the interval of time you want to add as described in settings. |
| dtDate1 |
Required. The first date that you want to use in the calculation. |
| dtDate2 |
Required. The second date that you want to use in the calculation. |
The settings for Interval are:
| Setting |
Description |
| yyyy |
Year. |
| q |
Quarter. |
| m |
Month. |
| d |
Day. |
| ww |
Week. |
| h |
Hour. |
| n |
Minute. |
| s |
Second. |
Remarks:
You can use the DateDiff function to determine how many specified time intervals exist between two dates. For example, you might use DateDiff to calculate the number of days between two dates, or the number of weeks between today and the end of the year.