Help Center

CPowerTime.DaysDiffmethod

Returns the days of difference between two dates.

DateTimemethoddocumented

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

NameDescription
cptThe CPowerTime object to compare.
nYear1A four digit year.
nMonth1A month number (1-12).
nDay1A day number (1-31).
nYear2A four digit year.
nMonth2A month number (1-12).
nDay2A 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