cancel
Showing results for 
Search instead for 
Did you mean: 

determine if date is in "daylight saving time" or "daylight saving time"

Former Member
0 Kudos

Hi,

has anybody of you sample coding to determine if a date is in "daylight saving time" or out "daylight saving time"?

Thanks regards

Mario

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mario,

Are you using a Calendar object? Then you can use the following code:


myCalendar.getTimeZone().inDaylightTime(myCalendar.getTime())

In any case, you need to know the timezone of the date, because some timezones have different DST dates.

Please refer to the class <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html">java.util.TimeZone</a>.

Best regards,

Daniel