I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 1.25
sub units 0.00
+
0
UnitsDate

weekday str

Returns a string for the weekday specified.
Controller: CodeCogs

Interface

C++
Excel

Weekday Str

 
char*weekday_strintweekDay
inttype = 1 )[const]
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 Tuesday

Parameters

weekDayis 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;
typeDefault 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.