weekday str
Returns a string for the weekday specified.
Controller: CodeCogs
Interface
C++
Excel
Weekday Str
char*weekday_str( | int | weekDay | |
int | type = 1 | )[const] |
Example 1
#include <stdio.h> #include <codecogs/units/date/weekday_str.h> #include <codecogs/units/date/dayofweek.h> #include <codecogs/units/date/date.h> using namespace Units::Date; int main() { int adate=date("10 october 2004"); for(int i=0;i<10;i++) printf("\n %d october 2005 occurs on a %s", 10+i, weekday_str(dayOfWeek(adate+i,3),3)); return 0; }
Output:10 october 2004 occurs on a Sunday 11 october 2004 occurs on a Monday 12 october 2004 occurs on a Tuesday 13 october 2004 occurs on a Wednesday 14 october 2004 occurs on a Thursday 15 october 2004 occurs on a Friday 16 october 2004 occurs on a Saturday 17 october 2004 occurs on a Sunday 18 october 2004 occurs on a Monday 19 october 2004 occurs on a Tuesday
Parameters
weekDay is the numeric day of the week, within the range specified by the type. Values outside this range are wrapped back into range. So WeekDay=13 is the same as WeekDay=5; type Default Value = 1
Authors
- Will Bateman (Sep 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.