}
  public int getOffset(int era, int year, int month,		       int day, int dayOfWeek, int millis)  {    int daysInMonth = getDaysInMonth(month, year);    if (day < 1 || day > daysInMonth)      throw new IllegalArgumentException("day out of range");    if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY)      throw new IllegalArgumentException("dayOfWeek out of range");    if (month < Calendar.JANUARY || month > Calendar.DECEMBER)      throw new IllegalArgumentException("month out of range");    // This method is called by Calendar, so we mustn't use that class.    int daylightSavings = 0;    if (useDaylight && era == GregorianCalendar.AD && year >= startYear)      {	// This does only work for Gregorian calendars :-(	// This is mainly because setStartYear doesn't take an era.	boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis,				       startMode, startMonth,				       startDay, startDayOfWeek, startTime);	boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis,				     endMode, endMonth,				     endDay, endDayOfWeek, endTime);	if (startMonth < endMonth)	  {	    // use daylight savings, if the date is after the start of	    // savings, and before the end of savings.	    daylightSavings = afterStart && beforeEnd ? dstSavings : 0;	  }	else	  {	    // use daylight savings, if the date is before the end of	    // savings, or after the start of savings.	    daylightSavings = beforeEnd || afterStart ? dstSavings : 0;	  }      }    return rawOffset + daylightSavings;  }