java - Check if additional hour due to DST -


in application must check if given hour zoneddatetime additional hour due dst. consider transition summer time winter time

1) *date* 01:00:00+02:00   2) *date* 02:00:00+02:00 3) *date* 02:00:00+01:00 4) *date* 03:00:00+01:00 

i want write simplest possible function isextrahour(zoneddate time) 1,2,4 return false , 3 case return true of course using java8 time api.

this use:

public boolean isextrahour(final zoneddatetime time) {   return time.getzone().getrules().getvalidoffsets(time.tolocaldatetime()).size() > 1; } 

note returns true whole hour of overlap, assume answer need.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -