Now new function to_tm() becomes available in arch/mips/kernel/time.c, the calculation for tm_wday looks incorrect. /* Days are what is left over (+1) from all that. */ tm->tm_mday = day + 1; /* * Determine the day of week */ tm->tm_wday = (day + 3) % 7; This code say that a first day of any month is Wednesday :-) Isn't this what you expected? gday = day = tim / SECDAY; ... tm->tm_wday = (gday + 4) % 7; /* 1970/1/1 was Thursday */ --- Atsushi Nemoto