FUNCTION
weekday_str
Returns a string for the weekday specified.
Interface
#include <codecogs/units/date/weekday_str.h>
using namespace Units::Date;
Returns a string pointer to the description of the numeric week day specified, i.e. "Sunday", "Monday", "Tuesday"
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 TuesdayParameters
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
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.