lkml.org 
[lkml]   [1998]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Y2K
Date
In article <Pine.LNX.3.96.980620000141.874A-100000@mullet.Levels.UniSA.Edu.Au>,
Alan Modra <alan@spri.levels.unisa.edu.au> wrote:
>
>On Fri, 19 Jun 1998, Rogier Wolff wrote:
>
>> This is not true. The question is: since when is THIS code snippet
>> in the linux kernel?
>>
>> linux/arch/i386/kernel/time.c: get_cmos_time:
>>
>> if ((year += 1900) < 1970)
>> year += 100;
>
>Since around July 94, when I added it as part of a patch to fix Linux for
>the silly half-hour timezone we have here in South Australia. The patch
>was against kernel 1.1.17, so I think kernels 1.1.18 and above were Y2K
>compliant.

What about the CMOS chips that wrap around to 01-01-1980 at 01-01-2000?
Shouldn't we make the check look like:

year += 1900;
/* Fix for CMOS chips without century bit */
if (year < 1970)
year += 100;
/* Fix for CMOS chips that wrap around to 01-01-80 */
if (year < 1995)
year += 20;

... which will save us from 2000 .. 2015

Mike.
--
Miquel van Smoorenburg | Our vision is to speed up time,
miquels@cistron.nl | eventually eliminating it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.090 / U:24.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site