date Diff
Computes the number of days between two serial Julian dates
Open Office: DATEDIFF
Controller: CodeCogs
Contents
Interface
C++
Excel
DateDiff
intdateDiff( | int | startDate | |
int | endDate | )[inline] |
inline int dateDiff(int nDateStart, int nDateEnd) { return nDateStart - nDateEnd; }
Example:
#include <stdio.h> #include <codecogs/units/date/date.h> using namespace Units::Date; void main() { printf("\n Difference=%d days", dateDiff(date("12-8-2004"), date("20-8-2004"))); // Difference=8 days }
Parameters
startDate and... endDate are serial Julian dates (see date ). The return value is signed, so if StartDate occurs before endDate then a negative answer will be returned. See date , for details on creating these numbers.
Authors
- Will Bateman (Oct 2004)
Source Code
Source code is available when you buy a Commercial licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.