Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 12, 2007 at 07:05 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 06:01 PM

    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 java.util.TimeZonehttp://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html">java.util.TimeZone>.

    Best regards,

    Daniel

    Add comment
    10|10000 characters needed characters exceeded