Link to home
Start Free TrialLog in
Avatar of danieldaniel_2000
danieldaniel_2000

asked on

for nieto

can u explain the code u post for the calendar?
how that equation works?
can u explain the number u used?
Avatar of nietod
nietod

Is this for me?

If so, I'm not sure what it refers to.
Avatar of danieldaniel_2000

ASKER

here it is:
can u tell me how u get those number for the equation?


From: nietod
 Date: Monday, February 08 1999 - 04:10PM PST  
For example,
// The date in dd/mm/yyyy.
int dd=1;
int mm=1;
int yy=1900;

int jdn;
char *weekday[]={"Tuesday",
"Wednesday",
"THursday",
"Friday",
"Saturday",
"Sunday",
"Monday"};

if (mm < 3)
{
   mm += 12;
   yy -= 1;
}
jdn = dd+1720996+(mm+1)*306/10+yy*365 + yy/4 - yy/100 + yy/400;

printf("%s\n",weeday[jdn%7]);
 
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial