Change of date

Hi, I need to know the dates in wich the hour is changed, I mean the winter hour and the summer hour, for every year.Anyone con help me? Thanks a lot.
[164 byte] By [Fabiavmza] at [2007-11-27 4:46:01]
# 1
the class java.util.TimeZone contains that information
jsalonena at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 2

Look at the TimeZone class. If you have further questions, please ask again.

The dates when summer time begins and ends vary from time zone to time zone (though some time zones share the same rules). Many time zones do not have summer time at all. You may be fine if you just look at the computer's default time zone (though I've seen computers running incorrect time zones, like a computer in Europe running an American time zone, but having its clock set incorrectly so it appears to show the correct time for the European time zone).

OleVVa at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 3
Thanks, I know that it depends on the time zone taht you are using, but what I need are the dates in wich the hour is changed.
Fabiavmza at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 4
So did we answer your question?
OleVVa at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 5
No, sorry, I need exactly the dates in wich it changes to summer and to winter time, like:20070325T010000Z;20071028T010000ZThis the readable format for sinchronizing Nokia E61, but I don't might if I get a Date or a Calenda object.
Fabiavmza at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 6
And looking at the TimeZone class, what did you find and what are you still missing?
OleVVa at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 7

It looks like there's no way to get the date and hour when the changes occur directly through the public API.

You can base a binary search on the inDaylightTime(Date) method.

If you are sure the program will only be run on one specific version of the JRE you can study the source code to determine the interface of the private API and use reflection to access it.

jsalonena at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...
# 8

> It looks like there's no way to get the date and hour

> when the changes occur directly through the public

> API.

Funny and surprising: You're right. The subclass SimpleTimeZone (which is used for about all time zones) has constructors and setters for setting the rules for when summer time begins and ends -- but no corresponding getters.

@OP, you may need to call useDaylightTime() first to determine if summer time is used at all. After that, I'd go with Joni Salonen's suggestion.

OleVVa at 2007-7-12 9:58:31 > top of Java-index,Java Essentials,Java Programming...