[Top] [All Lists]

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

To: Brad Parker <>
Subject: Re: to_tm() in kernel/time.c?
From: Jun Sun <>
Date: Tue, 9 Dec 2003 14:19:40 -0800
In-reply-to: <>; from on Tue, Dec 09, 2003 at 03:58:06PM -0500
Original-recipient: rfc822;
References: <>
User-agent: Mutt/1.2.5i
On Tue, Dec 09, 2003 at 03:58:06PM -0500, Brad Parker wrote:
> Can anyone tell me if to_tm() in kernel/time.c returns months as 0-11?
> (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 */

> 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.

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.


<Prev in Thread] Current Thread [Next in Thread>