datetime class : DayDiff(datetime) method
Description
Gets the difference between the caller instance and the argument in days.
Syntax
datetimeInstance.DayDiff(datetime argDatetime)
Arguments
Class | Name | Description |
datetime | argDatetime | A datetime class instance that is compared. |
Return value
Class | Description |
real | The difference between the caller instance and the argument in days. |
Sample code
1: | datetime dt = new datetime(2019,1,6,0,0,0); |
2: | datetime dt2 = new datetime(2019,1,6,12,0,0); |
3: | datetime dt3 = new datetime(2019,1,7,0,0,0); |
4: | real diff1 = d2.DayDiff(dt); // 0.5 |
5: | real diff2 = dt3.DayDiff(dt); // 1 |
Notes
The return value is a number that subtracts argument's time from the caller's time. The unit is days.
This method was added in the Ver 1.0.0.1.
Links for reference
None