Determine Whether Daylight Savings Time (DST) is Active in Java for a Specified Date

This is the answer for the machine on which the question is being asked:

TimeZone.getDefault().inDaylightTime( new Date() );

A server trying to figure this out for a client will need the client’s time zone. See @Powerlord answer for the reason why.

For any particular TimeZone

TimeZone.getTimeZone( "US/Alaska").inDaylightTime( new Date() );

Leave a Comment