day Of Week
Computes the day of the week (Sunday through to Monday), for the specified serial Julian date.
Controller: CodeCogs
Contents
Interface
C++
Excel
DayOfWeek
intdayOfWeek( | int | nDate | |
int | type = 1 | )[inline] |
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; }
- Type=1 (default) : return contains numbers 1 (Sunday) through 7 (Saturday).
- Type=2 : return contains numbers 1 (Monday) through 7 (Sunday).
- Type=3 : return contains numbers 0 (Monday) through 6 (Sunday).
Parameters
nDate is a serial number of days from 24 November 4714 BC (1 January 4713BC in the Julian Calendar) - also known as the Julian Period. type defines the output style for the day of the week
Authors
- Will Bateman (Oct 2004)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.