/** * Get the Era component of the specified time instant. * * @param instant the time instant in millis to query. */ public int get(long instant) { if (iChronology.getYear(instant) <= 0) { return DateTimeConstants.BCE; } else { return DateTimeConstants.CE; } }
public long roundFloor(long instant) { int year = iChronology.getYear(instant); int month = iChronology.getMonthOfYear(instant, year); return iChronology.getYearMonthMillis(year, month); }
/** * Get the Era component of the specified time instant. * * @param instant the time instant in millis to query. */ public int get(long instant) { if (iChronology.getYear(instant) <= 0) { return DateTimeConstants.BCE; } else { return DateTimeConstants.CE; } }
public long roundFloor(long instant) { int year = iChronology.getYear(instant); int month = iChronology.getMonthOfYear(instant, year); return iChronology.getYearMonthMillis(year, month); }
/** * @param instant millis from 1970-01-01T00:00:00Z */ int getWeekyear(long instant) { int year = getYear(instant); int week = getWeekOfWeekyear(instant, year); if (week == 1) { return getYear(instant + DateTimeConstants.MILLIS_PER_WEEK); } else if (week > 51) { return getYear(instant - (2 * DateTimeConstants.MILLIS_PER_WEEK)); } else { return year; } }
/** * @param millis from 1970-01-01T00:00:00Z * @param year precalculated year of millis */ abstract int getMonthOfYear(long millis, int year);
/** * @param instant millis from 1970-01-01T00:00:00Z */ int getWeekOfWeekyear(long instant) { return getWeekOfWeekyear(instant, getYear(instant)); }
/** * @param instant millis from 1970-01-01T00:00:00Z */ int getDayOfYear(long instant) { return getDayOfYear(instant, getYear(instant)); }
public int getMaximumValue(long instant) { int year = iChronology.getYear(instant); return iChronology.getDaysInYear(year); }
/** * @param instant millis from 1970-01-01T00:00:00Z */ int getDayOfYear(long instant) { return getDayOfYear(instant, getYear(instant)); }
/** * @param instant millis from 1970-01-01T00:00:00Z */ int getWeekOfWeekyear(long instant) { return getWeekOfWeekyear(instant, getYear(instant)); }
/** * @param millis from 1970-01-01T00:00:00Z * @param year precalculated year of millis */ abstract int getMonthOfYear(long millis, int year);
/** * Gets the maximum number of days in the month specified by the instant. * * @param instant millis from 1970-01-01T00:00:00Z * @return the maximum number of days in the month */ int getDaysInMonthMax(long instant) { int thisYear = getYear(instant); int thisMonth = getMonthOfYear(instant, thisYear); return getDaysInYearMonth(thisYear, thisMonth); }
/** * @param millis from 1970-01-01T00:00:00Z */ int getDayOfMonth(long millis) { int year = getYear(millis); int month = getMonthOfYear(millis, year); return getDayOfMonth(millis, year, month); }
public boolean isLeap(long instant) { int thisYear = iChronology.getYear(instant); if (iChronology.isLeapYear(thisYear)) { return (iChronology.getMonthOfYear(instant, thisYear) == iLeapMonth); } return false; }
/** * Gets the maximum number of days in the month specified by the instant. * * @param instant millis from 1970-01-01T00:00:00Z * @return the maximum number of days in the month */ int getDaysInMonthMax(long instant) { int thisYear = getYear(instant); int thisMonth = getMonthOfYear(instant, thisYear); return getDaysInYearMonth(thisYear, thisMonth); }
public boolean isLeap(long instant) { int thisYear = iChronology.getYear(instant); if (iChronology.isLeapYear(thisYear)) { return (iChronology.getMonthOfYear(instant, thisYear) == iLeapMonth); } return false; }
/** * @param millis from 1970-01-01T00:00:00Z */ int getDayOfMonth(long millis) { int year = getYear(millis); int month = getMonthOfYear(millis, year); return getDayOfMonth(millis, year, month); }
public long addWrapField(long instant, int years) { if (years == 0) { return instant; } // Return newly calculated millis value int thisYear = iChronology.getYear(instant); int wrappedYear = FieldUtils.getWrappedValue (thisYear, years, iChronology.getMinYear(), iChronology.getMaxYear()); return set(instant, wrappedYear); }
public long addWrapField(long instant, int years) { if (years == 0) { return instant; } // Return newly calculated millis value int thisYear = iChronology.getYear(instant); int wrappedYear = FieldUtils.getWrappedValue (thisYear, years, iChronology.getMinYear(), iChronology.getMaxYear()); return set(instant, wrappedYear); }