/** * Return the number of minutes in the dateTime * @throws IllegalDateTimeFieldException if there is no legal time component */ public int getMinutes() throws IllegalDateTimeFieldException { if ((mask & TIME_MASK) == 0) throw new IllegalDateTimeFieldException("Time not available"); return data[m]; }
/** * Return the number of hours in the dateTime * @throws IllegalDateTimeFieldException if there is no legal time component */ public int getHours() throws IllegalDateTimeFieldException { if ((mask & TIME_MASK) == 0) throw new IllegalDateTimeFieldException("Time not available"); return data[h]; }
/** * Return the number of years in the dateTime. * @throws IllegalDateTimeFieldException if there is no legal year component */ public int getYears() throws IllegalDateTimeFieldException { if ((mask & YEAR_MASK) == 0) throw new IllegalDateTimeFieldException("Year not available"); return data[CY]; }
/** * Return the month in the dateTime, this is in ISO8601 format so january = 1 * @throws IllegalDateTimeFieldException if there is no legal month component */ public int getMonths() throws IllegalDateTimeFieldException { if ((mask & MONTH_MASK) == 0) throw new IllegalDateTimeFieldException("Month not available"); return data[M]; }
/** * Return the number of years in the dateTime * @throws IllegalDateTimeFieldException if there is no legal day component */ public int getDays() throws IllegalDateTimeFieldException { if ((mask & DAY_MASK) == 0) throw new IllegalDateTimeFieldException("Day not available"); return data[D]; }
/** * Return the number of full seconds in the dateTime * @throws IllegalDateTimeFieldException if there is no legal time component */ public int getFullSeconds() throws IllegalDateTimeFieldException { if ((mask & TIME_MASK) == 0) throw new IllegalDateTimeFieldException("Time not available"); return data[s]; }
/** * Return the number of seconds in the dateTime, including fractional part * @throws IllegalDateTimeFieldException if there is no legal time component */ public double getSeconds() throws IllegalDateTimeFieldException { if ((mask & TIME_MASK) == 0) throw new IllegalDateTimeFieldException("Time not available"); return data[s] + fractionalSeconds; }
/** * Return the time component of the dateTime - i.e. just the hours/mins/seconds, * and returns the values in seconds. * @throws IllegalDateTimeFieldException if there is no legal time component */ public double getTimePart() throws IllegalDateTimeFieldException { if ((mask & TIME_MASK) == 0) throw new IllegalDateTimeFieldException("Time not available"); return ((data[h]) * 60l + data[m]) * 60l + getSeconds(); }