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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)