CPowerTime.DaysDiffmethod
Returns the days of difference between two dates.
Syntax
FUNCTION DaysDiff (BYREF cpt AS CPowerTime) AS LONG
FUNCTION DaysDiff (BYVAL nYear1 AS LONG, BYVAL nMonth1 AS LONG, BYVAL nDay1 AS LONG, BYVAL nYear2 AS LONG, BYVAL nMonth2 AS LONG, BYVAL nDay2 AS LONG) AS LONG
Parameters
| Name | Description | |
|---|---|---|
cpt | The CPowerTime object to compare. | |
nYear1 | A four digit year. | |
nMonth1 | A month number (1-12). | |
nDay1 | A day number (1-31). | |
nYear2 | A four digit year. | |
nMonth2 | A month number (1-12). | |
nDay2 | A day number (1-31). |
Description
Returns the days of difference between two dates.
The date part of the internal CPowerTime object is compared to the date part of the specified external CPowerTime object. The time-of-day part of each is ignored. The difference in number of days is returned as the result of the function.
Examples
DIM cpt AS CPowerTime cpt.NewDate(2019, 2, 2) DIM cpt2 AS CPowerTime cpt2.NewDate(1930, 12, 25) print cpt.DaysDiff(cpt2) ' --or-- print cpt2.DaysDiff(cpt)
DIM cpt AS CPowerTime print cpt.DaysDiff(2019, 2, 2, 1930, 12, 25)
Reference
- Defined in AfxNova/CPowerTime.inc:771
- Documented in DateTime/CPowerTime Class.md
- Topic: CPowerTime Class