<p>
It converts a {@link Calendar} into a {@link LocalTime} with the given {@link Chronology}
</p>

@param chronology {@link Chronology} to be used
@return the {@link LocalTime} created from the input and arguments
769500
public static final <T extends Calendar> Function<T, LocalTime> calendarToLocalTime(Chronology chronology) {
		return FnLocalTime.calendarToLocalTime(chronology);
	}
9408
@Override
    @SuppressWarnings("unchecked")
    public ChronoLocalDateTime<Symmetry010Date> localDateTime(TemporalAccessor temporal) {
        return (ChronoLocalDateTime<Symmetry010Date>) super.localDateTime(temporal);
    }
348050
private static long convertByYear(long instant, Chronology from, Chronology to) {
        return to.getDateTimeMillis
            (from.year().get(instant),
             from.monthOfYear().get(instant),
             from.dayOfMonth().get(instant),
             from.millisOfDay().get(instant));
    }
786300
public static final <T extends Date> Function<T, LocalTime> dateToLocalTime(Chronology chronology) {
		return FnLocalTime.dateToLocalTime(chronology);
	}
236008
@Override  // override with covariant return type
    public MinguoDate date(TemporalAccessor temporal) {
        if (temporal instanceof MinguoDate) {
            return (MinguoDate) temporal;
        }
        return new MinguoDate(LocalDate.from(temporal));
    }
729603
public DateTime toDateTime(DateTimeZone zone) {
        Chronology chrono = DateTimeUtils.getChronology(getChronology());
        chrono = chrono.withZone(zone);
        return new DateTime(getMillis(), chrono);
    }
893499
public static Calendar calendar(Date date) {
		if(date instanceof DateTime) {
			return ((DateTime)date).toCalendar();
		}else {
			return calendar(date.getTime());
		}
	}
431594
@Override
    @SuppressWarnings("unchecked")
    public ChronoLocalDateTime<AccountingDate> localDateTime(TemporalAccessor temporal) {
        return (ChronoLocalDateTime<AccountingDate>) super.localDateTime(temporal);
    }
1325184
public static final <T extends Calendar> Function<T, MutableDateTime> calendarToMutableDateTime(Chronology chronology) {
        return FnMutableDateTime.calendarToMutableDateTime(chronology);
    }
1311936
private void getMonthlyRelativeDates(Calendar calendar, int frequency, List<Date> dates)
   {
      long startDate = calendar.getTimeInMillis();
      calendar.set(Calendar.DAY_OF_MONTH, 1);
      int dayNumber = NumberHelper.getInt(m_dayNumber);

      while (moreDates(calendar, dates))
      {
         if (dayNumber > 4)
         {
            setCalendarToLastRelativeDay(calendar);
         }
         else
         {
            setCalendarToOrdinalRelativeDay(calendar, dayNumber);
         }

         if (calendar.getTimeInMillis() > startDate)
         {
            dates.add(calendar.getTime());
            if (!moreDates(calendar, dates))
            {
               break;
            }
         }
         calendar.set(Calendar.DAY_OF_MONTH, 1);
         calendar.add(Calendar.MONTH, frequency);
      }
   }
441720
@Override
    public Optional<Chronology<? extends CalendarDate>> findChronology(String name) {

        switch (name) {
            case "buddhist":
                return Optional.of(ThaiSolarCalendar.axis());
            case "chinese":
                return Optional.of(ChineseCalendar.axis());
            case "coptic":
                return Optional.of(CopticCalendar.axis());
            case "dangi":
                return Optional.of(KoreanCalendar.axis());
            case "ethiopic":
            case "ethioaa":
            case "ethiopic-amete-alem":
                return Optional.of(EthiopianCalendar.axis());
            case "gregory":
            case "gregorian":
            case CalendarText.ISO_CALENDAR_TYPE:
                return Optional.of(PlainDate.axis());
            case "hebrew":
                return Optional.of(HebrewCalendar.axis());
            case "historic":
                return Optional.of(HistoricCalendar.family());
            case "indian":
                return Optional.of(IndianCalendar.axis());
            case "islamic":
            case "islamic-rgsa":
            case "islamic-icu4j":
            case "islamic-diyanet":
            case "islamicc": // deprecated synonym for: islamic-civil
            case "islamic-civil":
            case "islamic-tbla":
            case "islamic-umalqura":
                return Optional.of(HijriCalendar.family());
            case "japanese":
                return Optional.of(JapaneseCalendar.axis());
            case "juche":
                return Optional.of(JucheCalendar.axis());
            case "julian":
                return Optional.of(JulianCalendar.axis());
            case "persian":
                return Optional.of(PersianCalendar.axis());
            case "roc":
                return Optional.of(MinguoCalendar.axis());
            case "vietnam":
                return Optional.of(VietnameseCalendar.axis());
            default:
                return Optional.empty();
        }

    }
930958
private void getYearlyRelativeDates(Calendar calendar, List<Date> dates)
   {
      long startDate = calendar.getTimeInMillis();
      calendar.set(Calendar.DAY_OF_MONTH, 1);
      calendar.set(Calendar.MONTH, NumberHelper.getInt(m_monthNumber) - 1);

      int dayNumber = NumberHelper.getInt(m_dayNumber);
      while (moreDates(calendar, dates))
      {
         if (dayNumber > 4)
         {
            setCalendarToLastRelativeDay(calendar);
         }
         else
         {
            setCalendarToOrdinalRelativeDay(calendar, dayNumber);
         }

         if (calendar.getTimeInMillis() > startDate)
         {
            dates.add(calendar.getTime());
            if (!moreDates(calendar, dates))
            {
               break;
            }
         }
         calendar.set(Calendar.DAY_OF_MONTH, 1);
         calendar.add(Calendar.YEAR, 1);
      }
   }
211358
@Override  // for covariant return type
    @SuppressWarnings("unchecked")
    public ChronoLocalDateTime<EthiopicDate> atTime(LocalTime localTime) {
        return (ChronoLocalDateTime<EthiopicDate>) super.atTime(localTime);
    }
1005643
public static final <T extends Calendar> Function<T, DateTime> calendarToDateTime(Chronology chronology) {
		return new CalendarToDateTime<T>(chronology);
	}
766853
public static <T> Chronology<T> lookup(Class<T> chronoType) {

        try {
            // Initialisierung der Klasse anstoßen, wenn noch nicht erfolgt
            Class.forName(
                chronoType.getName(),
                true,
                chronoType.getClassLoader());
        } catch (ClassNotFoundException cnfe) {
            throw new IllegalStateException(cnfe);
        }

        Chronology<?> ret = null;
        boolean purged = false;

        for (ChronoReference cref : CHRONOS) {
            Chronology<?> chronology = cref.get();

            if (chronology == null) {
                purged = true;
            } else if (chronology.getChronoType() == chronoType) {
                ret = chronology;
                break;
            }
        }

        if (purged) {
            purgeQueue();
        }

        return cast(ret); // type-safe

    }
429589
@Override
    @SuppressWarnings("unchecked")
    public ChronoLocalDateTime<CopticDate> localDateTime(TemporalAccessor temporal) {
        return (ChronoLocalDateTime<CopticDate>) super.localDateTime(temporal);
    }
967296
public static Calendar toCalendar(final LocalDate self) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DATE, self.getDayOfMonth());
        cal.set(Calendar.MONTH, self.getMonthValue() - 1);
        cal.set(Calendar.YEAR, self.getYear());
        clearTimeCommon(cal);
        return cal;
    }