to_tm() function in arch/mips/kernel/time.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux