// Count of day without Friday,saturday
static void San_DateFriSat(Args _args)
{
date d,f,g;
int i,months,day,countday;
d = mkDate(01,12,2014);
f = mkDate(31,12,2014);
g = nextMth(f);
months = intvNo(g,d,intvScale::Day);
//info(strfmt("%1",months));
for (i=0;i<= months;i++)
{
day = dayOfwk(d);
//info(strfmt("Weekday number - %1",day));
if (day == 1 || day == 2 || day == 3 || day == 4 || day ==7)
{
countday++;
}
d = d +1;
}
info(strFmt("%1",countday));
}
static void San_DateFriSat(Args _args)
{
date d,f,g;
int i,months,day,countday;
d = mkDate(01,12,2014);
f = mkDate(31,12,2014);
g = nextMth(f);
months = intvNo(g,d,intvScale::Day);
//info(strfmt("%1",months));
for (i=0;i<= months;i++)
{
day = dayOfwk(d);
//info(strfmt("Weekday number - %1",day));
if (day == 1 || day == 2 || day == 3 || day == 4 || day ==7)
{
countday++;
}
d = d +1;
}
info(strFmt("%1",countday));
}
No comments:
Post a Comment