How is java.util.TimeZone daylight info updated?

两盒软妹~` 提交于 2019-11-28 10:33:30

问题


I couldn't find a similar question around, so here it goes.

I need to create some alerts and basically identify when a daylight saving time approaches, i.e. next thursday daylight begins

Question How does Timezone knows the correct info?

I ask that because, for instance, in my country - Brazil - the day is defined one year before when it will happen by government. It could potentially not even exist on a specific year. This probably happens in other countries as well.

On Java Doc, the below info can be found:

This method returns a historically correct offset value if an underlying TimeZone implementation subclass supports historical Daylight Saving Time schedule and GMT offset changes

It says it returns a historically correct. But how trustworthy is this method for detecting timezones? Does it depends on regular java updates, does it read from somewhere in Windows, for instance ?

Thanks in advance!


回答1:


The link below explains the official method to update timezones in java

http://www.oracle.com/technetwork/java/javase/tzupdater-readme-136440.html

Basically, download the tool jar and run the command

java -jar tzupdater.jar options



来源:https://stackoverflow.com/questions/48630833/how-is-java-util-timezone-daylight-info-updated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!