From: John Cowan (firstname.lastname@example.org)
Date: Thu Nov 06 2003 - 07:54:08 EST
Doug Ewell scripsit:
> function Date.GetYear() that was intended to return the last two digits
> of the year but actually returned the year minus 1900. Of course,
> starting in 2000 the function returned a value which was useful to
> practically nobody.
How, not useful? C programmers have been dealing with (year - 1900)
since the 70s, and it is now 103. :-)
> Did Sun or ECMA change the definition of
> Date.GetYear()? No, they introduced a new function, Date.GetFullYear(),
> which does what users really want.
I wonder why they bothered, since it can be defined in a single line of
Now if GetYear() had indeed returned the last two digits, that would have
been annoying, since it could be used only for presentation, and in
order to get the actual year, one would have to impose an arbitrary
heuristic to map the 2-digit value to a year number.
-- Only do what only you can do. John Cowan <email@example.com> --Edsger W. Dijkstra, http://www.reutershealth.com deceased 6 August 2002 http://www.ccil.org/~cowan
This archive was generated by hypermail 2.1.5 : Thu Nov 06 2003 - 08:36:53 EST