TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Alan and Carmel Brain <[log in to unmask]>
Fri, 5 May 2000 21:13:29 +1000
text/plain (34 lines)
From: "Jacob Sparre Andersen" <[log in to unmask]>
> > I have heard that the programming language "C"   will out
> > grow its date package in I think 2030.
> > I was wondering if there is any fact to this?

> The year is 2038 iirc, and it is not as much a problem with
> C as with the date handling functions in many Unixes.
> Switching from a "32 bit compiler" to a "64 bit compiler"
> shold delay this problem a few million years.

Yes but....
The problem is that in the original Unix, all times are determined in the
number of seconds since 1970 IIRC. In any event, this is a 32-bit
integer, that will overflow at about 2am on Feb 18th, 2038, again IIRC.
This is because most Unices are written in C, and use the C standard
library functions.

The C programming language has standard libraries for converting
time in secs since 1970 to date, and vice-versa. The file structures
usually have the "time last accessed" as this 32-bit number. Converting
to a 64-bit compiler is great, but your OS and file structure might be
still affected.

So this affects only C and Unix, Right? Alas no, it affects a lot of
Operating Systems that have C components. Like Windows 95, 98,
NT, and I think 2000, also Win 3.11, in fact, a significant propoportion
of the world's computers. Of Macs I know not, but it wouldn't surprise
me if they had the same problem on some versions of their OS's,
especially the ones with significant bits of Unix in them (via Next).

So Ada for Windows might work, but Windows won't. Look up the
definition of "Y2k compliant" on the Microsoft site. They say ot means
"good till 2035" just for this reason.