The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Unix V7 updates
@ 2023-02-16 14:13 KenUnix
  2023-02-16 15:36 ` [TUHS] " Warner Losh
  0 siblings, 1 reply; 2+ messages in thread
From: KenUnix @ 2023-02-16 14:13 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 96 bytes --]

I was wondering if there are any fixes for Unix V7 to
use years beyond 2000?

-- 
WWL 📚

[-- Attachment #2: Type: text/html, Size: 305 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [TUHS] Re: Unix V7 updates
  2023-02-16 14:13 [TUHS] Unix V7 updates KenUnix
@ 2023-02-16 15:36 ` Warner Losh
  0 siblings, 0 replies; 2+ messages in thread
From: Warner Losh @ 2023-02-16 15:36 UTC (permalink / raw)
  To: KenUnix; +Cc: tuhs

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

Several different people have made them. I grabbed V7 date and added
the canonical hack to have years < 70 be 20xx and built it on my Venix
box. I've not done an extensive audit, but it's the only thing I've noticed.

Warner

P.S. It's short:

commit 25485e099491fd1ae867c26043a798e47f7983ad
Author: Warner Losh <imp@freebsd.org>
Date:   Thu Nov 15 23:51:59 2018 -0700

    Apply Y2K fix to date

    Treat all two digit dates < 70 as 20xx and >= 70 as 19xx.

diff --git a/src/cmd/date.c b/src/cmd/date.c
index a005765..643f7e7 100644
--- a/src/cmd/date.c
+++ b/src/cmd/date.c
@@ -133,7 +133,10 @@ gtime()
        if (hour<0 || hour>23)
                return(1);
        timbuf = 0;
-       year += 1900;
+       if (year < 70)
+               year += 2000;
+       else
+               year += 1900;
        for(i=1970; i<year; i++)
                timbuf += dysize(i);
        /* Leap year */

On Thu, Feb 16, 2023 at 7:14 AM KenUnix <ken.unix.guy@gmail.com> wrote:

> I was wondering if there are any fixes for Unix V7 to
> use years beyond 2000?
>
> --
> WWL 📚
>
>
>

[-- Attachment #2: Type: text/html, Size: 1826 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-16 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 14:13 [TUHS] Unix V7 updates KenUnix
2023-02-16 15:36 ` [TUHS] " Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).