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

Bug#433636: gcj-4.1: java.util.Calendar.setTimeZone fails to set ZONE_OFFSET



Package: gcj-4.1
Version: 4.1.1-20
Severity: normal

When running the following code from a CEST locale:

    Calendar cal = Calendar.getInstance();
    System.out.println( "Calendar: " + cal.toString() );
    cal.setTimeZone(TimeZone.getTimeZone("GMT"));
    cal.set(1970, 0, 1,    // year=1970, month=january, day=1
        0, 0, 0);          // hour, minute, second
    cal.set(Calendar.MILLISECOND, 0);
    System.out.println( "Calendar: " + cal.toString() );
    System.out.println( "cal: " + cal.getTime().getTime() );

the final println should print 0, but prints -3600000. The other
printlns show that the Calendar.setTimeZone call fails to clear
the ZONE_OFFSET property of the Calendar (timezone GMT does not
use daylight saving).

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (900, 'stable'), (300, 'testing'), (100, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages gcj-4.1 depends on:
ii  gcc-4.1                 4.1.1-21         The GNU C compiler
ii  gcj-4.1-base            4.1.1-20         The GNU Compiler Collection (gcj b
ii  gij-4.1                 4.1.1-20         The GNU Java bytecode interpreter
ii  java-common             0.25             Base of all Java packages
ii  libc6                   2.5-9+b1         GNU C Library: Shared libraries
ii  libc6-dev               2.5-9+b1         GNU C Library: Development Librari
ii  libgcc1                 1:4.2-20070627-1 GCC support library
ii  libgcj7-0               4.1.1-20         Java runtime library for use with 
ii  libgcj7-dev             4.1.1-20         Java development headers and stati
ii  libgcj7-jar             4.1.1-20         Java runtime library for use with 
ii  zlib1g                  1:1.2.3-13       compression library - runtime

Versions of packages gcj-4.1 recommends:
ii  fastjar                       1:4.1.1-21 Jar creation utility

-- no debconf information



Reply to: