JDK-4124203 : TIME problems in UK: How do I get "British Summer Time"?
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.5,1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95,windows_nt
  • CPU: x86
  • Submitted: 1998-03-31
  • Updated: 1998-04-14
  • Resolved: 1998-04-14
Related Reports
Duplicate :  
Description

Name: tb29552			Date: 03/31/98


The clocks just went forward in the U.K. to
daylight savings time, or British Summer Time
as it is known locally.

I note from Bug 4064735 that the GMT timezone
(which is the default I get when I installed
JDK 1.2b3, and JDK 115) no longer uses daylight
savings time 
(i.e. TimeZone.getDefault().useDaylightTime() = 
false)

This means that when I try to get the time using
Calendar.getInstance() it is an hour out. The clock
on my NT task bar s correct.

THIS IS VERY SERIOUS.

1) Should I be using another timezone, if so
which one is the correct one for the U.K (I can't
find this in the javadoc

2) If there is a correct time zone for the U.K,
why did the install of the JDK not set this as
my default time zone.

I NOW HAVE NO IDEA HOW TO GET THE CORRECT LOCAL
TIME !

Please help !

Rob
(Review ID: 27531)
======================================================================

Comments
WORK AROUND Name: tb29552 Date: 03/31/98 None known. ====================================================================== Submitted by another user: Here's our solution, DIY timezones ! Then use it via TimeZone.getDefault() where necessary. if (TimeZone.getDefault().getID().equals("GMT")) { SimpleTimeZone stz = new SimpleTimeZone(0, "DCH"); stz.setStartRule(Calendar.MARCH,-1,Calendar.SUNDAY,2*60*60*1000); stz.setEndRule(Calendar.OCTOBER,-1,Calendar.SUNDAY,2*60*60*1000); TimeZone.setDefault(stz); }
2004-06-11

SUGGESTED FIX tim.auckland@corp 1998-04-08 *** java/util/TimeZone.java.dist Tue Apr 7 10:09:46 1998 --- java/util/TimeZone.java Wed Apr 8 16:06:33 1998 *************** *** 237,244 **** // GMT is the ID for Greenwich Mean Time time zone. // Since Java treats GMT and UTC as synonyms, the GMT // time zone can't have daylight savings time. - // ??? We need a different zone for Britain. new SimpleTimeZone(0, "GMT"), // ECT is the ID for European Central Time time zone. new SimpleTimeZone(1 * millisPerHour, "ECT", Calendar.MARCH, -1, Calendar.SUNDAY, 2 * millisPerHour, --- 237,248 ---- // GMT is the ID for Greenwich Mean Time time zone. // Since Java treats GMT and UTC as synonyms, the GMT // time zone can't have daylight savings time. new SimpleTimeZone(0, "GMT"), + // GBT is a zone added for Britain because GMT is now used to + // mean real GMT. + new SimpleTimeZone(0, "GBT", + Calendar.MARCH, -1, Calendar.SUNDAY, 2*millisPerHour, + Calendar.OCTOBER, 4, Calendar.SUNDAY, 2*millisPerHour), // ECT is the ID for European Central Time time zone. new SimpleTimeZone(1 * millisPerHour, "ECT", Calendar.MARCH, -1, Calendar.SUNDAY, 2 * millisPerHour,
2004-06-11