Java timezone in turkey (rejected daylight saving)

后端 未结 2 1719
春和景丽
春和景丽 2020-12-03 20:11

Turkey decided recently (September 6, 2016 ) to permanently stay in Daylight Saving Time (DST). This act canceled the ending of DST previously scheduled for October 30, 2016

2条回答
  •  没有蜡笔的小新
    2020-12-03 20:34

    The prefered way to do this would be to update the JDK/JRE, if it includes the new timezone information. If it is not included, the correct, and official way to do this, should be to update the Timezone information using the Timezone Updater Tool.

    The TZUpdater tool is provided to allow you to update installed Java Development Kit (JDK) and Java Runtime Environment (JRE) software with more recent timezone data, to accommodate daylight saving time (DST) changes in different countries. Oracle relies on the timezone data publicly available through IANA's Time Zone Database.

    Oracle recommends that you use the latest Oracle Java SE platform JDK or JRE update release as the preferred means of delivering both timezone data updates and other product improvements, such as security fixes. To see which JDK or JRE update release incorporates the updated timezone data for your locale, see Timezone Data Versions in the JRE Software. However, if you are unable to use Oracle's latest JDK or JRE update release or if the timezone data on the latest release is not the most current one available, the TZUpdater tool provides a means of updating timezone data while leaving other system configuration and dependencies unchanged.

    It is available as a download on the official Java SE download site (under the section Additional Resources).

    Information about your particular case can be found here (where you can also see that the information is not available in a JRE release):

    Turkey switched from EET/EEST (+02/+03) to permanent +03, effective 2016-09-07. New leap second 2016-12-31 23:59:60 UTC as per IERS Bulletin C 52.

    How to use the tool is explained in the doucentation:

    The TZUpdater tool modifies the JDK/JRE software instance that is used to execute the tool. A single image of the JDK/JRE software is modified per execution. To administer the tool to multiple instances of the JDK/JRE software, see the section Systemwide Usage.

    For example, the below command would update the JRE with the latest information, where the changes in Turkey daylight saving should be included.

    java -jar tzupdater.jar -l http://www.iana.org/time-zones/repository/tzdata-latest.tar.gz


    Note that there is a current known issue since the 2016g release:

    Due to formatting changes in the IANA-maintained tzdata bundle, the TZUpdater tool fails to determine the tzdata version when parsing the tzdata2016.tar.gz resource bundle.

    Follow the steps from the below link in order to be able to use the latest tzdata bundle from IANA. When this is fixed, this section of the answer will be removed.

提交回复
热议问题