javatimezonedstiana

New rules for Brazil's Daylight Saving Time on Java


The rules for Brazil's Daylight Saving Time have been changed, but this new rules are not present on the newst java version.

On this test code, using the latest version provided by RedHat (java-1.8.0-openjdk-1.8.0.212-3) the results are not the expected:

    try {
        final SimpleDateFormat parser = new SimpleDateFormat( "dd/MM/yyyy" );
        final Date date = parser.parse( "05/12/2019" ); // 5th of december

        System.out.println( "Is in Daylight Saving Time in this time zone? "
            + TimeZone.getTimeZone( "America/Sao_Paulo" ).inDaylightTime( date ) );
    } catch ( ParseException exception ) {
        exception.printStackTrace();
    }

the output is:

Is in Daylight Saving Time in this time zone? true // should be false!

I've sent a e-mail to Iana (Internet Assigned Numbers Authority) - www.iana.org, and i'm waiting for them to reply.

Does anybody know anything about this?

Thanks

Edit: To clarify the question: I want to know how the updates on the TimeZone database works (when it will be done and by whom).

Sinse the the Iana answered my e-mail and explaned to me that the changes on Brazil's DST were made on Brazil has canceled DST - GitHub and it will be on the next release of the database, my question was answered.


Solution

  • This change was staged in the tz data in April (thread here, commit here). It will show up in 2019b when it is released.

    There has not been an announcement of precisely when that will happen yet, but you can subscribe to the tz-announce mailing list to be notified when it does.

    Of course you'll need to wait for a corresponding Java update, or use the ziupdater or tzupdater tools.