formatTwoDigits(time / MSPERHOUR, buff); time = time % MSPERHOUR; buff.append(':'); formatTwoDigits(time / MSPERMINUTE, buff); time = time % MSPERMINUTE; buff.append(':'); formatTwoDigits(time / 1000, buff); time = time % 1000;
/** * Format time in milliseconds to year number, month number, and day number. The resulting year * number format is consistent with W3C XML Schema definitions, using a minimum of four digits * for the year and exactly two digits each for the month and day. * * @param value time in milliseconds to be converted (from 1 C.E.) * @param buff text formatting buffer * @return number of milliseconds into day */ protected static int formatYearMonthDay(long value, StringBuffer buff) { // convert year and month long extra = formatYearMonth(value, buff); // append the day of month int day = (int) (extra / MSPERDAY) + 1; buff.append('-'); formatTwoDigits(day, buff); // return excess of milliseconds into day return (int) (extra % MSPERDAY); }
formatTwoDigits(month, buff);
throws IllegalArgumentException { formatTwoDigits(time / MSPERHOUR, buff); time = time % MSPERHOUR; buff.append(':'); formatTwoDigits(time / MSPERMINUTE, buff); time = time % MSPERMINUTE; buff.append(':'); formatTwoDigits(time / 1000, buff); time = time % 1000;
throws IllegalArgumentException { formatTwoDigits(time / MSPERHOUR, buff); time = time % MSPERHOUR; buff.append(':'); formatTwoDigits(time / MSPERMINUTE, buff); time = time % MSPERMINUTE; buff.append(':'); formatTwoDigits(time / 1000, buff); time = time % 1000;
/** * Format time in milliseconds to year number, month number, and day * number. The resulting year number format is consistent with W3C XML * Schema definitions, using a minimum of four digits for the year and * exactly two digits each for the month and day. * * @param value time in milliseconds to be converted (from 1 C.E.) * @param buff text formatting buffer * * @return number of milliseconds into day */ protected static int formatYearMonthDay(long value, StringBuffer buff) { // convert year and month long extra = formatYearMonth(value, buff); // append the day of month int day = (int) (extra / MSPERDAY) + 1; buff.append('-'); formatTwoDigits(day, buff); // return excess of milliseconds into day return (int) (extra % MSPERDAY); }
/** * Format time in milliseconds to year number, month number, and day * number. The resulting year number format is consistent with W3C XML * Schema definitions, using a minimum of four digits for the year and * exactly two digits each for the month and day. * * @param value time in milliseconds to be converted (from 1 C.E.) * @param buff text formatting buffer * * @return number of milliseconds into day */ protected static int formatYearMonthDay(long value, StringBuffer buff) { // convert year and month long extra = formatYearMonth(value, buff); // append the day of month int day = (int) (extra / MSPERDAY) + 1; buff.append('-'); formatTwoDigits(day, buff); // return excess of milliseconds into day return (int) (extra % MSPERDAY); }
formatTwoDigits(month, buff);
formatTwoDigits(month, buff);