-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
1.1.6_03
-
generic
-
solaris_2.6
JDK version: JDK1.1.6
1) There is insufficient documentation stating that the
year 0 AD is automatically converted to the year 1BC.
And the only way one can determine this is by checking
the ERA flag and one can learn this only by talking to a
developer, to clarify this problem is more than a "tutorial"
question as many may think it to be.
2) There is not sufficient documentation describing the
behaviour of the DateFormat class and the way it treats
the various years, there are different rules that come
into play based on the leniency flag which can be set,
there is very strange behaviour whether this flag is turned
on or not.
This is because some "heuristic" is being used and what this
heuristic does should be documented.
Some examples:
format: MM/dd/yy accepts 02/08/-1 thru 02/08/-9
does not accept 02/08/-10 (3 character year)
(Justification: -1 is a 2 character year,-10 onwards are not)
format: MM/dd/yyy demonstrates same behaviour as above BUT
-10 onwards are still not accepted,
based on the number of characters they should be accepted,
this behaviour is demonstrated even when the format
is MM/dd/yyyy (4 character years).
3) Behaviour of the 80/20 rule used by the DateFormat class,
especially when there are negative years being supplied,
there has been a bug created related to this, it is in the
"See also buglist".
1) There is insufficient documentation stating that the
year 0 AD is automatically converted to the year 1BC.
And the only way one can determine this is by checking
the ERA flag and one can learn this only by talking to a
developer, to clarify this problem is more than a "tutorial"
question as many may think it to be.
2) There is not sufficient documentation describing the
behaviour of the DateFormat class and the way it treats
the various years, there are different rules that come
into play based on the leniency flag which can be set,
there is very strange behaviour whether this flag is turned
on or not.
This is because some "heuristic" is being used and what this
heuristic does should be documented.
Some examples:
format: MM/dd/yy accepts 02/08/-1 thru 02/08/-9
does not accept 02/08/-10 (3 character year)
(Justification: -1 is a 2 character year,-10 onwards are not)
format: MM/dd/yyy demonstrates same behaviour as above BUT
-10 onwards are still not accepted,
based on the number of characters they should be accepted,
this behaviour is demonstrated even when the format
is MM/dd/yyyy (4 character years).
3) Behaviour of the 80/20 rule used by the DateFormat class,
especially when there are negative years being supplied,
there has been a bug created related to this, it is in the
"See also buglist".
- relates to
-
JDK-4182066 SimpleDateFormat parsing years -1 through -9 to 1999 through 1991.
- Resolved