bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/22847] java.util.Date toString() output should be localiz


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22847] java.util.Date toString() output should be localized
Date: 16 Oct 2005 01:27:26 -0000

After looking at a recent gcj bug, it appears the toString() output for GNU
Classpath's java.util.Date is missing the timezone information.

For example, the date/time 'Wed Jun 04 03:09:35  2003' is output as just that
under Classpath, while under Sun's VM, it is adapted to the local timezone,
including DST ('Wed Jun 04 04:09:35 BST 2003').  The gcj bug was still wrong in
using this output (as it differs depending on where the code is run), but maybe
we should be including this information as 'zzz' is a required part of
toString().

The time should remain being stored in GMT (getTime() comparisons succeed), but
on a toString() call, the GMT value should be localized to the timezone of the
default locale. 

I attach the file from the gcj bug.


------- Comment #1 from from-classpath at savannah dot gnu dot org  2005-03-28 
15:25 -------
Further, it seems that all three (toString(), toGMTString, toLocaleString())
are wrong.  At least, they don't match the JDK results.

Note that the locale for the following is en_GB.

>From JDK 1.5:
toString(): Mon Mar 28 16:19:33 BST 2005
toGMTString(): 28 Mar 2005 15:19:34 GMT
toLocaleString(): Mar 28, 2005 4:19:34 PM

>From Classpath/JamVM:
toString(): Mon Mar 28 15:15:50 GMT 2005
toGMTString(): 28/03/2005 15:15
toLocaleString(): 28/03/2005 15:15

None of the later make use of the local timezone (BST, the DST variant of GMT).
 When this bug was filed, the local timezone was GMT, so these differences were
not as clear.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22847





reply via email to

[Prev in Thread] Current Thread [Next in Thread]