linux-mips
[Top] [All Lists]

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

To: linux-mips@fnet.fr, linux-mips@oss.sgi.com
Subject: to_tm() function in arch/mips/kernel/time.c
From: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Date: Mon, 27 Aug 2001 17:12:41 +0900 (JST)
Cc: Ralf Baechle <ralf@uni-koblenz.de>
Organization: TOSHIBA Personal Computer System Corporation
Sender: owner-linux-mips@oss.sgi.com
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

<Prev in Thread] Current Thread [Next in Thread>
  • to_tm() function in arch/mips/kernel/time.c, Atsushi Nemoto <=