This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/17002] java.util.TimeZone.getDefault() is broken
- From: "mckinlay at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 26 Aug 2004 19:43:40 -0000
- Subject: [Bug libgcj/17002] java.util.TimeZone.getDefault() is broken
- References: <20040812133905.17002.mark@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mckinlay at redhat dot com 2004-08-26 19:43 -------
Unfortunately, this isn't yet fixed for some platforms, such as Fedora Core 2.
FC2 does not set the TZ environment variable, and it does not have an
/etc/timezone file.
Here's the test case:
import java.util.TimeZone;
public class TZ2
{
public static void main(String[] args)
{
TimeZone tz = TimeZone.getDefault();
System.out.println (tz.getID());
}
}
$ java TZ2
America/Toronto
$ gij TZ2
EST
I straced Sun's JVM to see if I could tell how it was getting the timezone ID:
open("/etc/sysconfig/clock", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xea75d000
read(4, "ZONE=\"America/Toronto\"\nUTC=true\n"..., 4096) = 42
close(4) = 0
Looks like we need to try the /etc/sysconfig/clock file also?
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17002