• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

struct tm y2k

For jhance,
Explain struct tm y2k.
0
ucc1207
Asked:
ucc1207
1 Solution
 
ozoCommented:
tm_year is years since 1900, so in the year 2000, it will be 100.
0
 
Brain2000Commented:
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.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now