public class ExcelStyleDateFormatter extends SimpleDateFormat
SimpleDateFormat
instance,
which handles a few Excel-style extensions that
are not supported by SimpleDateFormat
.
Currently, the extensions are around the handling
of elapsed time, eg rendering 1 day 2 hours
as 26 hours.DateFormat.Field
Modifier and Type | Field and Description |
---|---|
static char |
H_BRACKET_SYMBOL |
static char |
HH_BRACKET_SYMBOL |
static char |
L_BRACKET_SYMBOL |
static char |
LL_BRACKET_SYMBOL |
static char |
M_BRACKET_SYMBOL |
static char |
MM_BRACKET_SYMBOL |
static char |
MMMMM_START_SYMBOL |
static char |
MMMMM_TRUNCATE_SYMBOL |
static char |
S_BRACKET_SYMBOL |
static char |
SS_BRACKET_SYMBOL |
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
Constructor and Description |
---|
ExcelStyleDateFormatter() |
ExcelStyleDateFormatter(String pattern) |
ExcelStyleDateFormatter(String pattern,
DateFormatSymbols formatSymbols) |
ExcelStyleDateFormatter(String pattern,
Locale locale) |
Modifier and Type | Method and Description |
---|---|
StringBuffer |
format(Date date,
StringBuffer paramStringBuffer,
FieldPosition paramFieldPosition) |
void |
setDateToBeFormatted(double date)
Used to let us know what the date being
formatted is, in Excel terms, which we
may wish to use when handling elapsed
times.
|
applyLocalizedPattern, applyPattern, clone, equals, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, parse, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
format, parseObject
public static final char MMMMM_START_SYMBOL
public static final char MMMMM_TRUNCATE_SYMBOL
public static final char H_BRACKET_SYMBOL
public static final char HH_BRACKET_SYMBOL
public static final char M_BRACKET_SYMBOL
public static final char MM_BRACKET_SYMBOL
public static final char S_BRACKET_SYMBOL
public static final char SS_BRACKET_SYMBOL
public static final char L_BRACKET_SYMBOL
public static final char LL_BRACKET_SYMBOL
public ExcelStyleDateFormatter()
public ExcelStyleDateFormatter(String pattern)
public ExcelStyleDateFormatter(String pattern, DateFormatSymbols formatSymbols)
public void setDateToBeFormatted(double date)
public StringBuffer format(Date date, StringBuffer paramStringBuffer, FieldPosition paramFieldPosition)
format
in class SimpleDateFormat
Copyright © 2020. All rights reserved.