Reply to post: Re: Another 20 (18) years...

Y2K quick-fix crick? 1920s come roaring back after mystery blip at UK's vehicle licensing agency

J.G.Harston Silver badge

Re: Another 20 (18) years...

But the problem appears that they *haven't* used a sliding window, they've used a fixed window. If they used a sliding window, the roll-over year would advance a year into the future each year, eg a 2-digit year always resolving to a 4-digit year between 50 years ago and 50 years' time.

Eg:

if (year2 > (thisyear+50) MOD 100) year4=((thisyear DIV 100)-1)*100+year2

else year4=(thisyear DIV 100)*100+year2

// untested, fails on edge cases

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon