CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

UnitsDate

date Diff

Only available under a commercial licence
COST (GBP)
this unit 3.51
sub units 0.00
add a commercial licence to your cart
0
viewed 3238 times and licensed 21 times

Computes the number of days between two serial Julian dates Open Office: DATEDIFF

Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     add cart

Interface

#include <codecogs/units/date/datediff.h>

using namespace Units::Date;

int dateDiff (int startDate, int endDate)[inline]
Computes the number of days between two serial Julian dates Open Office: DATEDIFF
ExcelInteger cc_dateDiff (Integer startDate, Integer endDate)
This function is available as a Microsoft Excel add-in.

Function Documentation

Date Diff Calculator
  
Add calculator to website or email
 
intdateDiffintstartDate
intendDate )[inline]
Returns the number of days between two serial Julian dates. Aside from adding clarity to your code, we can see few reasons for anyone to use this function directly, we only provide it for completeness against Excel. For something more involved see dateDiff360. We recommend that you make the necessary subtraction yourself, the entire function is only:
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:
startDateand...
endDateare 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:

To view or download source code you need to buy a Commercial licence.

buy now     add cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-13 20:24:32

Valid CSS!   Valid XHTML 1.0 Transitional