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

Valid RSS

UnitsDate

weekday str

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 1.04
sub units 0.00
add a commercial licence to your cart
0
viewed 1567 times and licensed 15 times

Returns a string for the weekday specified.

Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

#include <codecogs/units/date/weekday_str.h>

using namespace Units::Date;

char* weekday_str (int weekDay, int type=1)
Returns a string for the weekday specified.
ExcelString cc_weekday_str (Integer weekDay, Integer type)
This function is available as a Microsoft Excel add-in.

Function Documentation

 
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:

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: 24 Feb 08 @ 10:42     Page Rendered: 2010-03-11 23:07:01

Valid CSS!   Valid XHTML 1.0 Transitional