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(a)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(a)gmail.com> wrote:
I was wondering if there are any fixes for Unix V7 to
use years beyond 2000?
--
WWL 📚