Subject: to_tm() in kernel/time.c?

From: Brad Parker <[email-masked]>
Date: Tue, 09 Dec 2003 15:58:06 -0500

Can anyone tell me if to_tm() in kernel/time.c returns months as 0-11?
(in the current mips tree, that is)

I'm curious if the to_tm() in the ppc tree is the same as the to_tm()
in the mips tree.  In the ppc tree it returns 1-12.

-brad

---

From: Jun Sun <[email-masked]>
Date: Tue, 9 Dec 2003 14:19:40 -0800

> (in the current mips tree, that is)

It is 0-11.  See the code

        tm->tm_mon = i - 1;             /* tm_mon starts from 0 to 11 */

> in the mips tree.  In the ppc tree it returns 1-12.

The routine was copied from PPC.  I think tm_mon is set to 0-11 so as to match
struct rtc_time usage when it is exported to userland.

I will check with PPC folks to see why they changed it.

Jun