2006-06-08 23:22:22 |
Allen Crider |
bug |
|
|
added bug |
2006-06-09 08:45:51 |
Andy Balaam |
description |
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;
import java.util.Date;
import java.util.GregorianCalendar;
public class TimeTester
{
public static void main( String[] args )
{
System.out.println("Current Time");
Calendar calendar = new GregorianCalendar();
Date trialTime = new Date();
calendar.setTime(trialTime);
// 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: " +
calendar.get(Calendar.WEEK_OF_YEAR));
System.out.println("WEEK_OF_MONTH: " +
calendar.get(Calendar.WEEK_OF_MONTH));
System.out.println("DATE: " + calendar.get(Calendar.DATE));
System.out.println("DAY_OF_MONTH: " +
calendar.get(Calendar.DAY_OF_MONTH));
System.out.println("DAY_OF_YEAR: " +
calendar.get(Calendar.DAY_OF_YEAR));
System.out.println("DAY_OF_WEEK: " +
calendar.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: " +
calendar.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: " +
calendar.get(Calendar.MILLISECOND));
System.out.println("ZONE_OFFSET: "
+
(calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000)));
System.out.println("DST_OFFSET: "
+
(calendar.get(Calendar.DST_OFFSET)/(60*60*1000)));
}
}
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;
import java.util.Date;
import java.util.GregorianCalendar;
public class TimeTester
{
public static void main( String[] args )
{
Calendar calendar = new GregorianCalendar();
Date trialTime = new Date();
calendar.setTime(trialTime);
System.out.println("ZONE_OFFSET: " + (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000)));
System.out.println("DST_OFFSET: " + (calendar.get(Calendar.DST_OFFSET)/(60*60*1000)));
}
}
When run using Sun Java, the DST_OFFSET is 0, even though my time zone is currently at Central Daylight Time so it should be 1. 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.
|
|
2006-06-09 08:45:51 |
Andy Balaam |
title |
Date() commands problem with DST |
Java reports time zone incorrectly during CDT (US Daylight saving time) |
|
2007-03-07 10:02:27 |
Mark Reitblatt |
sun-java5: status |
Unconfirmed |
Needs Info |
|
2007-03-07 10:02:27 |
Mark Reitblatt |
sun-java5: importance |
Undecided |
Low |
|
2007-03-07 10:02:27 |
Mark Reitblatt |
sun-java5: statusexplanation |
|
Seems to work for me here. Setting the date to June 1, 1997 as a test case worked. 2006/06/08 (date this was filed) works as well. Considering how long this has sat open with no attention, and my inability to reproduce the problem, I'm going to close the bug report.
If you feel this is in error and can provide a specific example (date) where Dapper/Feisty's Sun Java doesn't work, then please reopen the bug report. |
|
2007-03-07 10:02:38 |
Mark Reitblatt |
sun-java5: status |
Needs Info |
Rejected |
|
2007-03-07 10:02:38 |
Mark Reitblatt |
sun-java5: statusexplanation |
Seems to work for me here. Setting the date to June 1, 1997 as a test case worked. 2006/06/08 (date this was filed) works as well. Considering how long this has sat open with no attention, and my inability to reproduce the problem, I'm going to close the bug report.
If you feel this is in error and can provide a specific example (date) where Dapper/Feisty's Sun Java doesn't work, then please reopen the bug report. |
|
|
2007-03-07 10:43:55 |
Andy Balaam |
sun-java5: status |
Rejected |
Unconfirmed |
|
2007-03-07 10:43:55 |
Andy Balaam |
sun-java5: statusexplanation |
|
Re-opening since I can still reproduce. Please show what you did differently to make this not happen. |
|
2007-03-07 19:01:44 |
Mark Reitblatt |
sun-java5: status |
Unconfirmed |
Needs Info |
|
2007-03-07 19:01:44 |
Mark Reitblatt |
sun-java5: statusexplanation |
Re-opening since I can still reproduce. Please show what you did differently to make this not happen. |
Happily. I'm in time zone CST, and I ran the following code:
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class TimeTester
{
public static void main( String[] args )
{
Calendar calendar = new GregorianCalendar(106 + 1900, 6, 8);
// Date trialTime = new Date();
// calendar.setTime(trialTime);
System.out.println("ZONE_OFFSET: " + (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000)));
System.out.println("DST_OFFSET: " + (calendar.get(Calendar.DST_OFFSET)/(60*60*1000)));
}
}
Which printed out:
ZONE_OFFSET: -6
DST_OFFSET: 1 |
|
2007-03-08 12:33:48 |
Andy Balaam |
sun-java5: status |
Needs Info |
Unconfirmed |
|
2007-03-08 12:33:48 |
Andy Balaam |
sun-java5: statusexplanation |
Happily. I'm in time zone CST, and I ran the following code:
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class TimeTester
{
public static void main( String[] args )
{
Calendar calendar = new GregorianCalendar(106 + 1900, 6, 8);
// Date trialTime = new Date();
// calendar.setTime(trialTime);
System.out.println("ZONE_OFFSET: " + (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000)));
System.out.println("DST_OFFSET: " + (calendar.get(Calendar.DST_OFFSET)/(60*60*1000)));
}
}
Which printed out:
ZONE_OFFSET: -6
DST_OFFSET: 1 |
You are explicitly setting the time in the constructor for GregorianCalendar. Do you get the same results when you set your system date and then use the default constructor for GregorianCalendar? |
|
2007-04-10 11:34:04 |
Christian Assig |
bug |
|
|
assigned to sun-java6 (Ubuntu) |
2007-05-02 18:08:08 |
Christian Assig |
sun-java5: status |
Unconfirmed |
Confirmed |
|
2007-05-02 18:08:08 |
Christian Assig |
sun-java5: statusexplanation |
You are explicitly setting the time in the constructor for GregorianCalendar. Do you get the same results when you set your system date and then use the default constructor for GregorianCalendar? |
Setting to confirmed because Allen can reproduce the behaviour |
|
2007-05-02 18:08:24 |
Christian Assig |
sun-java6: status |
Unconfirmed |
Confirmed |
|
2007-05-02 18:08:24 |
Christian Assig |
sun-java6: statusexplanation |
|
Setting to confirmed because Allen can reproduce the behaviour |
|
2007-05-03 15:59:35 |
Mike Green |
bug |
|
|
added attachment 'sun-java5-tzupdater.tar.gz' (debian source package hack) |
2008-03-22 12:42:56 |
Matti Lindell |
bug |
|
|
assigned to sun-java5 (Debian) |
2008-03-23 12:09:12 |
Bug Watch Updater |
sun-java5: status |
Unknown |
New |
|
2010-01-12 09:04:27 |
Markus Strohmeier |
nominated for series |
|
Ubuntu Hardy |
|
2010-01-12 09:04:27 |
Markus Strohmeier |
nominated for series |
|
Ubuntu Intrepid |
|
2010-01-12 09:04:27 |
Markus Strohmeier |
nominated for series |
|
Ubuntu Lucid |
|
2010-01-12 09:04:27 |
Markus Strohmeier |
nominated for series |
|
Ubuntu Dapper |
|
2010-01-12 09:04:27 |
Markus Strohmeier |
nominated for series |
|
Ubuntu Karmic |
|
2010-01-12 09:04:27 |
Markus Strohmeier |
nominated for series |
|
Ubuntu Jaunty |
|
2010-02-21 16:10:29 |
Mark Reitblatt |
removed subscriber Mark Reitblatt |
|
|
|
2013-03-08 19:27:24 |
Rakesh Rao |
bug |
|
|
added subscriber Marcus Liang |
2015-04-09 20:42:08 |
Bug Watch Updater |
sun-java5 (Debian): status |
New |
Fix Released |
|