Incorrect offset for TimeZone casablanca (java)

I am trying to create a date (07/29/2012 at 02:55:08 AM) in the time zone of Casablanca and received this exception:

Exception in thread "main" java.lang.IllegalArgumentException: HOUR_OF_DAY: 2 → 3 on java.util.GregorianCalendar.computeTime (Unknown source)

Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("Africa/Casablanca"));
cal.setLenient(false);
cal.set(Calendar.DATE, 29);
cal.set(Calendar.MONTH, 6); // July
cal.set(Calendar.YEAR, 2014);
cal.set(Calendar.HOUR_OF_DAY, 2);
cal.set(Calendar.MINUTE, 55);
cal.set(Calendar.SECOND, 8);
cal.getTime();

An exception is thrown with jre 1.7.0_71 and 1.8.0_20, but not with 1.6.0_30.

As far as I know, daylight saving time does not occur at this particular time. Any idea?

Thank!

+4
source share
2 answers

JRE . , TZUpdater. Oracle JRE TZUpdater. , JRE ( ) 65 Java 7 11 Java 8 - 2014c tzdata.

tzdata 2014c, , DST 29 - 29 .

Rule    Morocco 2014    only    -   Jun  29      3:00   0       -
Rule    Morocco 2014    only    -   Jul  29      2:00   1:00    S

, , , , .

, tz , .

+4

. . . http://www.timeanddate.com/news/time/egypt-morocco-dst-ramadan-2014.html.

2014 :

Rule    Morocco 2014    only    -       Jun     28       3:00   0       -
Rule    Morocco 2014    only    -       Aug      2       2:00   1:00    S
+2

All Articles