public class HybridDateFormat extends DateFormat
DateFormat.Field
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 |
---|
HybridDateFormat()
Constructs a SimpleDateFormat using the default pattern for the default
locale.
|
HybridDateFormat(String pattern)
Creates a date formatter using the specified pattern, with the default
DateFormatSymbols for the default locale.
|
HybridDateFormat(String pattern,
DateFormatSymbols formatData)
Creates a date formatter using the specified pattern.
|
HybridDateFormat(String pattern,
Locale locale)
Creates a date formatter using the specified pattern, with the default
DateFormatSymbols for the given locale.
|
Modifier and Type | Method and Description |
---|---|
void |
applyLocalizedPattern(String pattern)
This method sets the formatting pattern that should be used by this
object.
|
void |
applyPattern(String pattern)
This method sets the formatting pattern that should be used by this
object.
|
boolean |
equals(Object o)
This methods tests whether the specified object is equal to this object.
|
StringBuffer |
format(Date date,
StringBuffer buffer,
FieldPosition pos)
Formats the date input according to the format string in use, appending
to the specified StringBuffer.
|
Date |
get2DigitYearStart()
Returns the start of the century used for two digit years.
|
DateFormatSymbols |
getDateFormatSymbols()
This method returns the format symbol information used for parsing and
formatting dates.
|
Date |
parse(String dateStr,
ParsePosition pos)
This method parses the specified string into a date.
|
void |
set2DigitYearStart(Date date)
Sets the start of the century used for two digit years.
|
void |
setDateFormatSymbols(DateFormatSymbols formatData)
This method sets the format symbols information used for parsing and
formatting dates.
|
String |
toLocalizedPattern()
This method returns a string with the formatting pattern being used by
this object.
|
String |
toPattern()
This method returns a string with the formatting pattern being used by
this object.
|
String |
toString() |
clone, format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, hashCode, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
format, formatToCharacterIterator, parseObject
public HybridDateFormat()
public HybridDateFormat(String pattern)
public HybridDateFormat(String pattern, Locale locale)
public HybridDateFormat(String pattern, DateFormatSymbols formatData)
public String toPattern()
public String toLocalizedPattern()
public void applyPattern(String pattern)
pattern
- The new format pattern.public void applyLocalizedPattern(String pattern)
pattern
- The new format pattern.public Date get2DigitYearStart()
Date
representing the start of the century for two
digit years.public void set2DigitYearStart(Date date)
date
- A Date
representing the start of the century for
two digit years.public DateFormatSymbols getDateFormatSymbols()
public void setDateFormatSymbols(DateFormatSymbols formatData)
formatData
- The date format symbols.public boolean equals(Object o)
null
.SimpleDateFormat
.DateFormat
) level.equals
in class DateFormat
o
- The object to compare for equality against.true
if the specified object is equal to this
object, false
otherwise.public StringBuffer format(Date date, StringBuffer buffer, FieldPosition pos)
format
in class DateFormat
public Date parse(String dateStr, ParsePosition pos)
parse
in class DateFormat
dateStr
- The date string to parse.pos
- The input and output parse positionnull
if the string cannot be
parsed.Copyright © 2015–2021 Fiji. All rights reserved.