From: Warner Losh <imp@bsdimp.com>
To: KenUnix <ken.unix.guy@gmail.com>
Cc: tuhs@tuhs.org
Subject: [TUHS] Re: Unix V7 updates
Date: Thu, 16 Feb 2023 08:36:23 -0700 [thread overview]
Message-ID: <CANCZdfopGr6X-6As1=jUKUdHZfP786L9UrQeEDGS+gS9JHfMSg@mail.gmail.com> (raw)
In-Reply-To: <CAJXSPs_pD6HWG4Os9WDXqHyBPA7qYfNC90e_q2R2x2yr-G+twA@mail.gmail.com>
[-- 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 --]
prev parent reply other threads:[~2023-02-16 15:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 14:13 [TUHS] " KenUnix
2023-02-16 15:36 ` Warner Losh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANCZdfopGr6X-6As1=jUKUdHZfP786L9UrQeEDGS+gS9JHfMSg@mail.gmail.com' \
--to=imp@bsdimp.com \
--cc=ken.unix.guy@gmail.com \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).