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

Valid RSS

UnitsDate

day Of Week

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 3405 times and licensed 98 times

Computes the day of the week (Sunday through to Monday), for the specified 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/dayofweek.h>

using namespace Units::Date;

int dayOfWeek (int nDate, int type=1)[inline]
Computes the day of the week (Sunday through to Monday), for the specified serial Julian date.
ExcelInteger cc_dayOfWeek (Integer nDate, Integer type)
This function is available as a Microsoft Excel add-in.

Function Documentation

Day Of Week Calculator
  
Add calculator to website or email
 
intdayOfWeekintnDate
inttype = 1 )[inline]
Calculates the week day from a serial Julian date. This is correct for both the Gregorian and Julian calendar. The solution is merely:
DayOfWeek = (nDate+1)\ mod\ 7 + 1
Example 1:
#include <stdio.h>
#include <codecogs/units/date/dayofweek.h>
#include <codecogs/units/date/date.h>
using namespace Units::Date;
 
int main()
{
  for(int i=10;i<20;i++)
  {
    int adate=date(2004, 10, i);
    printf("\n %d October 2004 is %d day of week", i, dayOfWeek(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.
typedefines the output style for the day of the week
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-11 23:04:52

Valid CSS!   Valid XHTML 1.0 Transitional