<p>
The input {@link Date} is converted into a {@link DateTime} with the given
{@link Chronology}
</p>

@param chronology {@link Chronology} to be used
@return the {@link DateTime} created from the input and arguments
329502
public static final <T extends Date> Function<T, DateTime> dateToDateTime(Chronology chronology) {
		return new DateToDateTime<T>(chronology);
	}
565994
public static final <T extends Date> Function<T, MutableDateTime> dateToMutableDateTime(Chronology chronology) {
        return FnMutableDateTime.dateToMutableDateTime(chronology);
    }
1140900
@SuppressWarnings("unchecked")
    @Override
    public ChronoLocalDateTimeImpl<D> with(TemporalAdjuster adjuster) {
        if (adjuster instanceof ChronoLocalDate) {
            // The Chronology is checked in with(date,time)
            return with((ChronoLocalDate) adjuster, time);
        } else if (adjuster instanceof LocalTime) {
            return with(date, (LocalTime) adjuster);
        } else if (adjuster instanceof ChronoLocalDateTimeImpl) {
            return ChronoLocalDateTimeImpl.ensureValid(date.getChronology(), (ChronoLocalDateTimeImpl<?>) adjuster);
        }
        return ChronoLocalDateTimeImpl.ensureValid(date.getChronology(), (ChronoLocalDateTimeImpl<?>) adjuster.adjustInto(this));
    }
302161
public void setTime(final ReadableInstant instant) {
        long instantMillis = DateTimeUtils.getInstantMillis(instant);
        Chronology instantChrono = DateTimeUtils.getInstantChronology(instant);
        DateTimeZone zone = instantChrono.getZone();
        if (zone != null) {
            instantMillis = zone.getMillisKeepLocal(DateTimeZone.UTC, instantMillis);
        }
        setTime(instantMillis);
    }
32652
private static long convertByWeekyear(final long instant, Chronology from, Chronology to) {
        long newInstant;
        newInstant = to.weekyear().set(0, from.weekyear().get(instant));
        newInstant = to.weekOfWeekyear().set(newInstant, from.weekOfWeekyear().get(instant));
        newInstant = to.dayOfWeek().set(newInstant, from.dayOfWeek().get(instant));
        newInstant = to.millisOfDay().set(newInstant, from.millisOfDay().get(instant));
        return newInstant;
    }
913927
public static Calendar toCalendar(final Date date) {
        final Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c;
    }
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);
      }
   }
1216555
public void printTo(Appendable appendable, ReadableInstant instant) throws IOException {
        long millis = DateTimeUtils.getInstantMillis(instant);
        Chronology chrono = DateTimeUtils.getInstantChronology(instant);
        printTo(appendable, millis, chrono);
    }
166064
static boolean hasUnixChronology(Chronology<?> chronology) {

        Chronology<?> c = chronology;

        do {
            if (UnixTime.class.isAssignableFrom(c.getChronoType())) {
                return true;
            }
        } while ((c = c.preparser()) != null);

        return false;

    }
623121
public Observance getObservance(Date date) {
		Boundary boundary = getObservanceBoundary(date);
		return (boundary == null) ? null : boundary.getObservanceIn();
	}
757869
public static final <T extends Calendar> Function<T, LocalDate> calendarToLocalDate(Chronology chronology) {
		return new CalendarToLocalDate<T>(chronology);
	}
211824
static <R extends ChronoLocalDate> ChronoZonedDateTimeImpl<R> ofInstant(Chronology chrono, Instant instant, ZoneId zone) {
        ZoneRules rules = zone.getRules();
        ZoneOffset offset = rules.getOffset(instant);
        Jdk8Methods.requireNonNull(offset, "offset");  // protect against bad ZoneRules
        LocalDateTime ldt = LocalDateTime.ofEpochSecond(instant.getEpochSecond(), instant.getNano(), offset);
        @SuppressWarnings("unchecked")
        ChronoLocalDateTimeImpl<R> cldt = (ChronoLocalDateTimeImpl<R>) chrono.localDateTime(ldt);
        return new ChronoZonedDateTimeImpl<R>(cldt, offset, zone);
    }
943590
public static final <T extends Calendar> Function<T, LocalDate> calendarToLocalDate(Chronology chronology) {
		return FnLocalDate.calendarToLocalDate(chronology);
	}
336065
public static PlainDate from(GregorianDate date) {

        if (date instanceof PlainDate) {
            return (PlainDate) date;
        } else {
            return PlainDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth());
        }

    }
234094
public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
        if (base == null) {
            throw new IllegalArgumentException("Must supply a chronology");
        }
        base = base.withUTC();
        if (base == null) {
            throw new IllegalArgumentException("UTC chronology must not be null");
        }
        if (zone == null) {
            throw new IllegalArgumentException("DateTimeZone must not be null");
        }
        return new ZonedChronology(base, zone);
    }
561211
public final void setDate(final Date date) {
		this.date = (Date) date.clone();
		dateStr = ArchiveUtils.get14DigitDate(date);
	}
562662
void addChronoChangedListener(Consumer<Chronology> listener) {
        if (chronoListeners == null) {
            chronoListeners = new ArrayList<Consumer<Chronology>>();
        }
        chronoListeners.add(listener);
    }