• C

struct tm y2k

For jhance,
Explain struct tm y2k.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tm_year is years since 1900, so in the year 2000, it will be 100.
tm_year is actually a signed int.  Therefore, it can hit 127 before it flips to a negative number.  THAT MEANS ALL UNIX SYSTEMS WILL BREAK IN THE YEAR 2027!!!  They will think it's the year 1772.  Or something near that.

Believe it or not, someone has already registered www.2027.com (which links to a porn site at the moment).  What they fail to realize, is we have the source code to Unix, and can easily change it to an UNSIGNED long and last another 128 years before we break... again.

Therefore, the tm structure IS Y2K compliant, but not all the way through the 21st century as it will break in 2027.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.