I need to find the weekday from the given date; I have following code but does not work
int day;
char *str ="25/02/2014";
struct tm tm;
if (strptime(str, "%d/%m/%Y", &tm) != NULL)
{
time_t t = mktime(&tm);
day = localtime(&t)->tm_wday;
return day;
}
What am I doing wrong here?