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

Valid RSS

UnitsDate

day Of Year

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 2.34
sub units 0.00
add a commercial licence to your cart
0
viewed 2856 times and licensed 56 times

Computes the Gregorian day of the year from a serial Julian date.

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

Interface

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

using namespace Units::Date;

int dayOfYear (int nDate)[inline]
Computes the Gregorian day of the year from a serial Julian date.
ExcelInteger cc_dayOfYear (Integer nDate)
This function is available as a Microsoft Excel add-in.

Function Documentation

Day Of Year Calculator
  
Add calculator to website or email
 
intdayOfYearintnDate )[inline]
This function calculates the day of the year from a serial date, such that 1st January = 1 and 31st December = 365 or 366 in a leap year. The Gregorian calendar is assumed for these calculations. The most general solution for our Julian mode is:
a = (nDate + 31738)\ mod\ 146097\ mod\ 36524\ mod\ 1461
b = a/1460
DayOfYear = (a-b)\ mod\ 365 + b + 1
where nDate is equal to the Julian Period, and all division are integer divisions.
Example 1:
#include <stdio.h>
#include <codecogs/units/date/dayofyear.h>
#include <codecogs/units/date/date.h>
using namespace Units::Date;
 
int main()
{
  for(int i=5;i<15;i++)
  {
    int adate=date(2004, 2, i);
    printf("\n %d February 2004 is %d day of year", i, dayOfYear(adate));
  }
  return 0;
}
Parameters:
nDateis a serial number of days from 24 November 4714 BC (1 January 4713BC in the Julian Calendar) - also known as the Julian Period.
Authors:
Will Bateman (Oct 2004)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to 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-12 17:44:41

Valid CSS!   Valid XHTML 1.0 Transitional