Link to home
Start Free TrialLog in
Avatar of superabbe
superabbe

asked on

tm_wday

How do figure what day it is in a week ??
i want a func whitch gives me a number like 6 for sunday
or 0 as monday
asctime ????

Thanks superabbe@hotmail.com
Avatar of superabbe
superabbe

ASKER

sorry about the spelling
Its saturday and i'm having a good time !
ASKER CERTIFIED SOLUTION
Avatar of mlev
mlev

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
Oops, sorry. More like this:
time_t t = time(NULL);
struct tm *tp = localtime(&t);
tp->tm_wday; /* Sunday = 0, Monday = 6 */
But can I make this statement now ?

if (tm_wday==0)
        printf("sunday");

Thanks
/Abbe
Almost...
if (tp->tm_wday == 0)
      printf("sunday");