This is the mail archive of the java-prs@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/17002] java.util.TimeZone.getDefault() is broken


------- Additional Comments From mark at klomp dot org  2004-08-26 20:34 -------
Subject: Re:  java.util.TimeZone.getDefault() is broken

Hi,

On Thu, 2004-08-26 at 21:43, mckinlay at redhat dot com wrote:
> ------- 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. 

Even so, if the system property user.timezone isn't set, the TZ
environment variable isn't set, there isn't a /etc/timezone, and not
/etc/localtime then we still have the libc/posix way of getting the time
zone information.

> 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

Isn't EST correct for Toronto?
You only print the ID not the whole timezone information. Please check
all information of the given timezone and see if any of that information
is incorrect for you system.

Maybe you think that the ID should be different but I think this is not
covered by this bug. Please see the TimeZone meta bug for an overview of
other issues with TimeZone [Bug libgcj/16990].

Thanks,

Mark


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]