When run using Sun Java, the DST_OFFSET is 0, even though my time zone is currently at Central Daylight Time. I also tried alternatives to Sun Java. Blackdown Java has the same problem, but GNU Java and Kaffe produce the correct results. Unfortunately, Sun Java is the only package that has been able to run FreeGuide-TV for me so far, which is what I was using when I discovered this bug.
Binary package hint: sun-java5-bin
The following source code (provided to me by a developer on the FreeGuide-TV project) demonstrates the problem:
import java.util.Calendar; GregorianCalend ar;
import java.util.Date;
import java.util.
public class TimeTester
{
public static void main( String[] args )
System. out.println( "Current Time"); ar();
calendar. setTime( trialTime) ;
{
Calendar calendar = new GregorianCalend
Date trialTime = new Date();
// print out a bunch of interesting things
System. out.println( "ERA: " + calendar. get(Calendar. ERA));
System. out.println( "YEAR: " + calendar. get(Calendar. YEAR));
System. out.println( "MONTH: " + calendar. get(Calendar. MONTH)) ;
System. out.println( "WEEK_OF_ YEAR: " + get(Calendar. WEEK_OF_ YEAR));
System. out.println( "WEEK_OF_ MONTH: " + get(Calendar. WEEK_OF_ MONTH)) ;
System. out.println( "DATE: " + calendar. get(Calendar. DATE));
System. out.println( "DAY_OF_ MONTH: " + get(Calendar. DAY_OF_ MONTH)) ;
System. out.println( "DAY_OF_ YEAR: " + get(Calendar. DAY_OF_ YEAR));
System. out.println( "DAY_OF_ WEEK: " + get(Calendar. DAY_OF_ WEEK));
System. out.println( "DAY_OF_ WEEK_IN_ MONTH: "
+ calendar. get(Calendar. DAY_OF_ WEEK_IN_ MONTH)) ;
System. out.println( "AM_PM: " + calendar. get(Calendar. AM_PM)) ;
System. out.println( "HOUR: " + calendar. get(Calendar. HOUR));
System. out.println( "HOUR_OF_ DAY: " + get(Calendar. HOUR_OF_ DAY));
System. out.println( "MINUTE: " + calendar. get(Calendar. MINUTE) );
System. out.println( "SECOND: " + calendar. get(Calendar. SECOND) );
System. out.println( "MILLISECOND: " + get(Calendar. MILLISECOND) );
System. out.println( "ZONE_OFFSET: "
+ get(Calendar. ZONE_OFFSET) /(60*60* 1000))) ;
System. out.println( "DST_OFFSET: "
+ get(Calendar. DST_OFFSET) /(60*60* 1000))) ;
calendar.
calendar.
calendar.
calendar.
calendar.
calendar.
calendar.
(calendar.
(calendar.
}
}
When run using Sun Java, the DST_OFFSET is 0, even though my time zone is currently at Central Daylight Time. I also tried alternatives to Sun Java. Blackdown Java has the same problem, but GNU Java and Kaffe produce the correct results. Unfortunately, Sun Java is the only package that has been able to run FreeGuide-TV for me so far, which is what I was using when I discovered this bug.