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
i want a func whitch gives me a number like 6 for sunday
or 0 as monday
asctime ????
Thanks superabbe@hotmail.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, sorry. More like this:
time_t t = time(NULL);
struct tm *tp = localtime(&t);
tp->tm_wday; /* Sunday = 0, Monday = 6 */
time_t t = time(NULL);
struct tm *tp = localtime(&t);
tp->tm_wday; /* Sunday = 0, Monday = 6 */
ASKER
But can I make this statement now ?
if (tm_wday==0)
printf("sunday");
Thanks
/Abbe
if (tm_wday==0)
printf("sunday");
Thanks
/Abbe
Almost...
if (tp->tm_wday == 0)
printf("sunday");
if (tp->tm_wday == 0)
printf("sunday");
ASKER
Its saturday and i'm having a good time !