java - TimeZone ID coming incorrectly daylight time -


can please explain this?

timezone tz1 = timezone.gettimezone(“cst”); ==> id of tz1 cst timezone tz2 = timezone.gettimezone(“cdt”); ==> id of tz2 gmt ???? 

for me following test code produces "not found => cdt":

for (string tz : timezone.getavailableids()) {     if (tz.equals("cdt")) {         system.out.println("found: " + tz);     } }  system.out.println("not found => cdt"); 

that means java.util.timezone fall non-existing cdt zone "gmt" documented:

returns: specified timezone, or gmt zone if given id cannot understood.

in java 8 have alternative of zoneid has not unintuitive fallback behaviour instead throwing zonerulesexception consider better.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -