delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

It won't be a problem again until we need 5-digit years.
And by then, computers will fix this problem themselves.


The Y2K bug had to do with 2-digit years. Fixing it makes everything 4-digit years. It won't be a problem again until we need 5-digit years.
And by then, computers will fix this problem themselves.

TOP

You considered the consequences and made an informed decision.  I'm not going to look you up in 132 years and upbraid you if you just happened to misjudge the longevity of your utility.  I might look you up and congratulate you, though.  Give you a six-pack of Yuengling, or something.

TOP

Why ever use 2-digit years?  are you using some filesystem that still restricts you to 8-character filenames?  I would have just named the file ex20080723.log; in fact I've just gotten myself in the habit of recording all date strings this way.  not to say I haven't used (or even written) systems using 2-digit years out of convenience or laziness, but in this modern age I can't see the same kind of memory/filesystem constraints that caused people to use the smaller date format anymore.  there just doesn't seem to be any reason *not* to use 4-digit years (but perhaps I'm mistaken).  As for 5-digit years, I doubt even my (by then) genetically-enhanced cyborg body will make it another 8000 years... and as LyonHaert said, by then they should fix themselves, regardless of whether they've killed off the human race or not...

TOP


Originally Posted by medialint
I just wrote a function that will fail promptly on January 1, 2100.
actually, won't it run okay until July 23rd 2108?  that's when the files will start overwriting each other, right?  and, actually, who needs more than 100 years' history of web tracking data, anyway? given that the same hardcoded filesystem/network paths still exist, the app should still be viable -- unless you go looking for data more than 100 years old... maybe what you've actually done is written an 'undocumented disk-space maintenance algorithm' into your program, ensuring that no more than 36,525 log files will ever be used to store your data...

TOP

abstract:

It won't be a problem again until we need 5-digit years.
And by then, computers will fix this problem themselves.



Originally Posted by medialint
Read it again. This particular function will definitely fail promptly. It's certainly not a unique case. We're still using 2 digit years. Of course if everything remained the same in this particular scenario the worst thing that would happen is some 100 year old web traffic reporting tool won't have any data to report. Not the end of the world.
I didn't say it wouldn't fail. My point is that it's not a Y2.1K thing.
<ObviousStuff>
It's the same problem as Y2K. A program that will fail in 2000 due to a lack of precision on year values is not Y2K compliant and will fail at
every
turn-of-the-century.
It's only called Y2K because that's when it came up. If this had happened a century ago it would have been given the misnomer of 'the MCM bug' or something. It's actually just a lack of precision defect. Anybody who has fixed such things is using 4-digit years. So like I said, lack of precision in year values won't be a problem again until 4 digits constitutes a lack of precision, assuming precision even matters by then.
</ObviousStuff>
By then, our systems will at least be able to automatically tell the difference correctly between "10034-130-051" and "4845-07-29" without the latter needing to be upgraded to "04845-007-029".*
Summation: If it ever comes up again, it'll be near 10000 CE. And that's a really big if. I say it'll never happen again.
But something else will.
* I'm not clear here. It would be the same problem again if 12345 was truncated to 4-digit 2345 and was then indistinguishable from 02345 truncated similarly. What I was trying to imply is that the problem was bred by only allocating two digits to save space. That kind of byte-pinching no long matters now, but we still have limitations on the size of fields. My speculation is that such limitations will be archaic.

TOP

With any luck it won't really matter in 92 years because some young upstart will have come in and changed it while muttering about old buggers who have no idea what they're doing less than 6 months after you leave the job. Furthermore, within 25 years of you leaving the job, some young upstart manager will come in and declare everything archaic and stone age and demand that everything be replaced down to the last lug nut.
So no worries.
Interestingly enough I just finished taking the exact opposite position on a project I'm working on now. That in 195 years someone could go digging for those records and not be sure if they're from 2008 or 2108. (I'm pretty sure they'd exclude 1908.)

TOP


Originally Posted by medialint
it's specifically looking for files within the last ten days and only keeping 10 days worth of files on the destination.
so, I get the idea about Y2.1K and people still not really addressing the 'centennial bug' (to give it a more anachronistic name), but if you're only storing 10 days of data it seems that you're covered in any event, since 10 days of data will never cross over the 100 year mark, and as long as your code is all looking for dates relative to today and truncating to the last two digits, your data will always be correct... am I missing something?
@LyonHaert -- really, it depends on how the code's written
if you deal with 4-digit years in application code and only truncate for looking up data filenames, then the problem should not manifest itself until you try to look up something more than 100 years old (and then only because the naming convention does not allow more than 100 years' data)... similarly, as long as your file creation is destructive, you'll just overwrite 100-year-old files as the time period wraps around, and keep your 100-year window viable, uh, 'forever'...
consider this:  I want to find all log files in the last ten days; I'm going to first find the date for 10 days ago, then truncate the year value, create the string, and find all the files between that string and the same for the current date.  this may have a problem between christmas 1999 and early january 2000, but you'd have to write code around that anyway (since the years are only 2-digit in the filenames).  in this case, the same code would suffice between christmas 2099 and early jan 2100.  the only way your code would break on the stroke after midnight, jan 1 2100, is if you had a hardcode that literally prepends the string '20' to a 2-digit date, or that specifically removes the string '20' from the date (or, as a variant, the first 2 digits of the current century instead of the string '20').  am I wrong?  and if so, why?
not trying to bug anyone... just trying to see if/where my logic fails on this one.  obviously, just about all code written today will be gone in 92 years, but it's an interesting question of how viable the code will remain even with its centennial limitations.  it's something I thought pretty heavily about 9-or-so years ago and hadn't thought of recently, so yippee for something fun to think about...
--derelict

TOP

I either have 4-length years or epoch timestamp or no years at all. So: NEVER! Haha.

TOP

How could a timestamp be wrong though? The only way I can see is if the computer's time is horribly wrong.
I mean, my time stamps: Calendar.getInstance().getTimeInMillis(); -- direct call to the machine's clock.



It won't be a problem again until we need 5-digit years.
And by then, computers will fix this problem themselves.

TOP

Back Forum