SimpleDateFormat is a concrete class for formatting and
parsing dates in a locale-sensitive manner. It allows for formatting
(date → text), parsing (text → date), and normalization.
SimpleDateFormat allows you to start by choosing
any user-defined patterns for date-time formatting. However, you
are encouraged to create a date-time formatter with either
getTimeInstance, getDateInstance, or
getDateTimeInstance in DateFormat. Each
of these class methods can return a date/time formatter initialized
with a default format pattern. You may modify the format pattern
using the applyPattern methods as desired.
For more information on using these methods, see
DateFormat.
Date and time formats are specified by date and time pattern
strings.
Within date and time pattern strings, unquoted letters from
'A' to 'Z' and from 'a' to
'z' are interpreted as pattern letters representing the
components of a date or time string.
Text can be quoted using single quotes (') to avoid
interpretation.
"''" represents a single quote.
All other characters are not interpreted; they're simply copied into the
output string during formatting or matched against the input string
during parsing.
The following pattern letters are defined (all other characters from
'A' to 'Z' and from 'a' to
'z' not in the table below are reserved). applyPattern(String),
applyLocalizedPattern(String), and the SimpleDateFormat constructors throw IllegalArgumentException when
passed a pattern containing an unquoted reserved character.
Pattern letters are usually repeated, as their number determines the exact presentation:
Letter Date or Time Component Presentation Examples GEra designator Text ADyYear Year 1996;96YWeek year Year 2009;09MMonth in year (context sensitive) Month July;Jul;07LMonth in year (standalone form) Month July;Jul;07wWeek in year Number 27WWeek in month Number 2DDay in year Number 189dDay in month Number 10FDay of week in month Number 2EDay name in week Text Tuesday;TueuDay number of week (1 = Monday, ..., 7 = Sunday) Number 1aAm/pm marker Text PMHHour in day (0-23) Number 0kHour in day (1-24) Number 24KHour in am/pm (0-11) Number 0hHour in am/pm (1-12) Number 12mMinute in hour Number 30sSecond in minute Number 55SMillisecond Number 978zTime zone General time zone Pacific Standard Time;PST;GMT-08:00ZTime zone RFC 822 time zone -0800XTime zone ISO 8601 time zone -08;-0800;-08:00
Calendar is the Gregorian
calendar, the following rules are applied.SimpleDateFormat must interpret the abbreviated year
relative to some century. It does this by adjusting dates to be
within 80 years before and 20 years after the time the SimpleDateFormat
instance is created. For example, using a pattern of "MM/dd/yy" and a
SimpleDateFormat instance created on Jan 1, 1997, the string
"01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64"
would be interpreted as May 4, 1964.
During parsing, only strings consisting of exactly two digits, as defined by
Character#isDigit(char), will be parsed into the default century.
Any other numeric string, such as a one digit string, a three or more digit
string, or a two digit string that isn't all digits (for example, "-1"), is
interpreted literally. So "01/02/3" or "01/02/003" are parsed, using the
same pattern, as Jan 2, 3 AD. Likewise, "01/02/-3" is parsed as Jan 2, 4 BC.
'Y' is specified and the calendar doesn't support any week
years, the calendar year ('y') is used instead. The
support of week years can be tested with a call to getCalendar().isWeekDateSupported().DateFormatSymbols has been set explicitly with constructor
SimpleDateFormat(String, DateFormatSymbols) or method setDateFormatSymbols(DateFormatSymbols), the month names given by
the DateFormatSymbols are used.
GMTOffsetTimeZone:
GMT Sign Hours : Minutes
Sign: one of
+ -
Hours:
Digit
Digit Digit
Minutes:
Digit Digit
Digit: one of
0 1 2 3 4 5 6 7 8 9
Hours must be between 0 and 23, and Minutes must be between
00 and 59. The format is locale independent and digits must be taken
from the Basic Latin block of the Unicode standard.
For parsing, RFC 822 time zones are also
accepted.
RFC822TimeZone:
Sign TwoDigitHours Minutes
TwoDigitHours:
Digit Digit
TwoDigitHours must be between 00 and 23. Other definitions
are as for general time zones.
For parsing, general time zones are also accepted.
ISO8601TimeZone:
OneLetterISO8601TimeZone
TwoLetterISO8601TimeZone
ThreeLetterISO8601TimeZone
OneLetterISO8601TimeZone:
Sign TwoDigitHours
Z
TwoLetterISO8601TimeZone:
Sign TwoDigitHours Minutes
Z
ThreeLetterISO8601TimeZone:
Sign TwoDigitHours : Minutes
Z
Other definitions are as for general time zones or
RFC 822 time zones.
For formatting, if the offset value from GMT is 0, "Z" is
produced. If the number of pattern letters is 1, any fraction of an hour
is ignored. For example, if the pattern is "X" and the time zone is
"GMT+05:30", "+05" is produced.
For parsing, "Z" is parsed as the UTC time zone designator.
General time zones are not accepted.
If the number of pattern letters is 4 or more, IllegalArgumentException is thrown when constructing a SimpleDateFormat or applying a
pattern.
SimpleDateFormat also supports localized date and time
pattern strings. In these strings, the pattern letters described above
may be replaced with other, locale dependent, pattern letters.
SimpleDateFormat does not deal with the localization of text
other than the pattern letters; that's up to the client of the class.
Date and Time Pattern Result "yyyy.MM.dd G 'at' HH:mm:ss z"2001.07.04 AD at 12:08:56 PDT"EEE, MMM d, ''yy"Wed, Jul 4, '01"h:mm a"12:08 PM"hh 'o''clock' a, zzzz"12 o'clock PM, Pacific Daylight Time"K:mm a, z"0:08 PM, PDT"yyyyy.MMMMM.dd GGG hh:mm aaa"02001.July.04 AD 12:08 PM"EEE, d MMM yyyy HH:mm:ss Z"Wed, 4 Jul 2001 12:08:56 -0700"yyMMddHHmmssZ"010704120856-0700"yyyy-MM-dd'T'HH:mm:ss.SSSZ"2001-07-04T12:08:56.235-0700"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"2001-07-04T12:08:56.235-07:00"YYYY-'W'ww-u"2001-W27-3
Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.
API Note
Consider using java. as an
immutable and thread-safe alternative.
java.util.Calendar , java.util.TimeZone , DateFormat, DateFormatSymbols, java.time.format.DateTimeFormatter
| Modifier and Type | Field and Description |
|---|---|
| private static final ConcurrentMap | cachedNumberFormatData
Cache NumberFormat instances with Locale key. |
| private transient char[] | compiledPattern
The compiled pattern. |
| pack-priv static final int | |
| private Date | defaultCenturyStart
We map dates with two-digit years into the century starting at
|
| private transient int | |
| private transient boolean | forceStandaloneForm
True if standalone form needs to be used. |
| private DateFormatSymbols | formatData
The symbols used by this formatter for week names, month names, etc. May not be null. |
| private static final String | |
| private transient boolean | hasFollowingMinusSign
True when a negative sign follows a number. |
| private Locale | locale
The Locale used to instantiate this
|
| private static final int | |
| private transient char | minusSign
The minus sign to be used with format and parse. |
| private transient NumberFormat | originalNumberFormat
Saved numberFormat and pattern. |
| private transient String | |
| private String | pattern
The pattern string of this formatter. |
| private static final int[] | |
| private static final int[] | |
| private static final DateFormat. | |
| private static final int[] | |
| private int | serialVersionOnStream
The version of the serialized data on the stream. |
| pack-priv static final long | |
| private static final int | TAG_QUOTE_ASCII_CHAR
Tags for the compiled pattern. |
| private static final int | |
| pack-priv transient boolean | useDateFormatSymbols
Indicates whether this |
| private transient char | zeroDigit
Locale dependent digit zero. |
| Access | Constructor and Description |
|---|---|
| public | SimpleDateFormat()
Constructs a Note This constructor may not support all locales. |
| public | SimpleDateFormat(String
the pattern describing the date and time format pattern)Constructs a Note This constructor may not support all locales. |
| public | SimpleDateFormat(String
the pattern describing the date and time format pattern, Locale the locale whose date format symbols should be used locale)Constructs a Note This constructor may not support all locales. |
| public | SimpleDateFormat(String
the pattern describing the date and time format pattern, DateFormatSymbols the date format symbols to be used for formatting formatSymbols)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public void | applyLocalizedPattern(String
a String to be mapped to the new date and time format
pattern for this format pattern)Applies the given localized pattern string to this date format. |
| public void | applyPattern(String
the new date and time pattern for this date format pattern)Applies the given pattern string to this date format. |
| private void | |
| private boolean | |
| private void | checkNegativeNumberExpression()
Analyze the negative subpattern of DecimalFormat and set/update values as necessary. |
| public Object | Returns: a clone of thisSimpleDateFormatOverrides java. Creates a copy of this |
| private char[] | |
| private static void | encode(int tag, int length, StringBuilder buffer)
Encodes the given tag and length and puts encoded char(s) into buffer. |
| public boolean | Returns: true if the specified object is equal to this SimpleDateFormatobject to be compared for equality obj)Overrides java. Compares the specified object with this |
| public StringBuffer | Returns: the formatted date-time string.the date-time value to be formatted into a date-time string. date, StringBuffer where the new date-time text is to be appended. toAppendTo, FieldPosition keeps track on the position of the field within
the returned string. For example, given a date-time text
pos)"1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition
is DateFormat#YEAR_FIELD, the begin index and end index of
fieldPosition will be set to 0 and 4, respectively.
Notice that if the same date-time field appears more than once in a
pattern, the fieldPosition will be set for the first occurrence
of that date-time field. For instance, formatting a Date to the
date-time string "1 PM PDT (Pacific Daylight Time)" using the
pattern "h a z (zzzz)" and the alignment field
DateFormat#TIMEZONE_FIELD, the begin index and end index of
fieldPosition will be set to 5 and 8, respectively, for the
first occurrence of the timezone pattern character 'z'.Implements abstract java. Formats the given |
| pack-priv final Format. | format(Date date, Format.
Overrides java.
|
| private Format. | |
| public AttributedCharacterIterator | Returns: AttributedCharacterIterator describing the formatted value.The object to format obj)Overrides java. Formats an Object producing an |
| public Date | Returns: the start of the 100-year period into which two digit years are parsedReturns the beginning date of the 100-year period 2-digit years are interpreted as being within. |
| public DateFormatSymbols | Returns: the date and time format symbols of this date formatGets a copy of the date and time format symbols of this date format. |
| private Map | getDisplayContextNamesMap(int field, Locale locale)
Obtains display names map, taking the context into account. |
| private Map | |
| public int | Returns: the hash code value for thisSimpleDateFormatOverrides java. Returns the hash code value for this |
| private void | |
| private void | |
| private void | |
| private boolean | |
| private boolean | |
| private int | Returns: the new start position if matching succeeded; a negative number indicating matching failure, otherwise.the time text being parsed. text, int where to start parsing. start, int the date field being parsed. field, String[] the string array to parsed. data, CalendarBuilder calb)Private code-size reduction function used by subParse. |
| private int | matchString(String text, int start, int field, Map<String, Integer> data, CalendarBuilder calb)
Performs the same thing as matchString(String, int, int, String[]). |
| private int | |
| public Date | Returns: ADate parsed from the string. In case of
error, returns null.A text, ParsePosition String, part of which should be parsed.A pos)ParsePosition object with index and error
index information as described above.Implements abstract java. Parses text from a string to produce a |
| private void | |
| private void | readObject(ObjectInputStream stream)
After reading an object from the input stream, the format pattern in the object is verified. |
| public void | set2DigitYearStart(Date
During parsing, two digit years will be placed in the range
startDate)startDate to startDate + 100 years.Sets the 100-year period 2-digit years will be interpreted as being in to begin on the date the user specifies. |
| public void | setDateFormatSymbols(DateFormatSymbols
the new date and time format symbols newFormatSymbols)Sets the date and time format symbols of this date format. |
| private boolean | |
| private void | subFormat(int patternCharIndex, int count, Format.
Private member function that does the real date/time formatting. |
| private int | Returns: the new start position if matching succeeded; -1 indicating matching failure, otherwise. In case matching failure occurred, an error index is set to origPos.errorIndex.the time text to be parsed. text, int where to start parsing. start, int the index of the pattern character. patternCharIndex, int the count of a pattern character. count, boolean if true, then the next field directly abuts this one,
and we should use the count to know when to stop parsing. obeyCount, boolean[] return parameter; upon return, if ambiguousYear[0]
is true, then a two-digit year was parsed and may need to be readjusted. ambiguousYear, ParsePosition origPos.errorIndex is used to return an error index
at which a parse error occurred, if matching failure occurs. origPos, boolean useFollowingMinusSignAsDelimiter, CalendarBuilder calb)Private member function that converts the parsed date strings into timeFields. |
| private int | Returns: updated parsed position, or its negative value to indicate a parsing errorthe text to be parsed text, int the character position to start parsing start, int 1: positive; -1: negative sign, int 0: 'Z' or "GMT+hh:mm" parsing; 1 - 3: the number of 'X's count, boolean true - colon required between hh and mm; false - no colon required colon, CalendarBuilder a CalendarBuilder in which the parsed value is stored calb)Parses numeric forms of time zone offset, such as "hh:mm", and sets calb to the parsed value. |
| private int | subParseZoneString(String text, int start, CalendarBuilder calb)
find time zone 'text' matched zoneStrings and set to internal calendar. |
| public String | Returns: a localized pattern string describing this date format.Returns a localized pattern string describing this date format. |
| public String | Returns: a pattern string describing this date format.Returns a pattern string describing this date format. |
| public String | Returns: a string identifying thisSimpleDateFormat, for debuggingOverrides java. Returns a string identifying this |
| private String | translatePattern(String pattern, String from, String to)
Translates a pattern, mapping each character in the from string to the corresponding character in the to string. |
| private boolean | useDateFormatSymbols()
Returns true if the DateFormatSymbols has been set explicitly or locale is null. |
| private void | zeroPaddingNumber(int value, int minDigits, int maxDigits, Format.
Formats a number with the specified minimum and maximum number of digits. |
| cachedNumberFormatData | back to summary |
|---|---|
| private static final ConcurrentMap<Locale, NumberFormat> cachedNumberFormatData Cache NumberFormat instances with Locale key. | |
| compiledPattern | back to summary |
|---|---|
| private transient char[] compiledPattern The compiled pattern. | |
| currentSerialVersion | back to summary |
|---|---|
| pack-priv static final int currentSerialVersion | |
| defaultCenturyStart | back to summary |
|---|---|
| private Date defaultCenturyStart We map dates with two-digit years into the century starting at
| |
| defaultCenturyStartYear | back to summary |
|---|---|
| private transient int defaultCenturyStartYear | |
| forceStandaloneForm | back to summary |
|---|---|
| private transient boolean forceStandaloneForm True if standalone form needs to be used. | |
| formatData | back to summary |
|---|---|
| private DateFormatSymbols formatData The symbols used by this formatter for week names, month names, etc. May not be null.
| |
| GMT | back to summary |
|---|---|
| private static final String GMT | |
| hasFollowingMinusSign | back to summary |
|---|---|
| private transient boolean hasFollowingMinusSign True when a negative sign follows a number. (True as default in Arabic.) | |
| locale | back to summary |
|---|---|
| private Locale locale The Locale used to instantiate this
| |
| MILLIS_PER_MINUTE | back to summary |
|---|---|
| private static final int MILLIS_PER_MINUTE | |
| minusSign | back to summary |
|---|---|
| private transient char minusSign The minus sign to be used with format and parse. | |
| originalNumberFormat | back to summary |
|---|---|
| private transient NumberFormat originalNumberFormat Saved numberFormat and pattern. | |
| originalNumberPattern | back to summary |
|---|---|
| private transient String originalNumberPattern | |
| pattern | back to summary |
|---|---|
| private String pattern The pattern string of this formatter. This is always a non-localized pattern. May not be null. See class documentation for details. | |
| PATTERN_INDEX_TO_CALENDAR_FIELD | back to summary |
|---|---|
| private static final int[] PATTERN_INDEX_TO_CALENDAR_FIELD | |
| PATTERN_INDEX_TO_DATE_FORMAT_FIELD | back to summary |
|---|---|
| private static final int[] PATTERN_INDEX_TO_DATE_FORMAT_FIELD | |
| PATTERN_INDEX_TO_DATE_FORMAT_FIELD_ID | back to summary |
|---|---|
| private static final DateFormat. | |
| REST_OF_STYLES | back to summary |
|---|---|
| private static final int[] REST_OF_STYLES | |
| serialVersionOnStream | back to summary |
|---|---|
| private int serialVersionOnStream The version of the serialized data on the stream. Possible values:
serialVersionOnStream
is written.
| |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Hides java. | |
| TAG_QUOTE_ASCII_CHAR | back to summary |
|---|---|
| private static final int TAG_QUOTE_ASCII_CHAR Tags for the compiled pattern. | |
| TAG_QUOTE_CHARS | back to summary |
|---|---|
| private static final int TAG_QUOTE_CHARS | |
| useDateFormatSymbols | back to summary |
|---|---|
| pack-priv transient boolean useDateFormatSymbols Indicates whether this | |
| zeroDigit | back to summary |
|---|---|
| private transient char zeroDigit Locale dependent digit zero. | |
| SimpleDateFormat | back to summary |
|---|---|
| public SimpleDateFormat() Constructs a Note This constructor may not support all locales.
For full coverage, use the factory methods in the | |
| SimpleDateFormat | back to summary |
|---|---|
| public SimpleDateFormat(String pattern) Constructs a Note This constructor may not support all locales.
For full coverage, use the factory methods in the This is equivalent to calling
| |
| SimpleDateFormat | back to summary |
|---|---|
| public SimpleDateFormat(String pattern, Locale locale) Constructs a Note This constructor may not support all locales.
For full coverage, use the factory methods in the
| |
| SimpleDateFormat | back to summary |
|---|---|
| public SimpleDateFormat(String pattern, DateFormatSymbols formatSymbols) Constructs a
| |
| applyLocalizedPattern | back to summary |
|---|---|
| public void applyLocalizedPattern(String pattern) Applies the given localized pattern string to this date format.
| |
| applyPattern | back to summary |
|---|---|
| public void applyPattern(String pattern) Applies the given pattern string to this date format.
| |
| applyPatternImpl | back to summary |
|---|---|
| private void applyPatternImpl(String pattern) | |
| charEquals | back to summary |
|---|---|
| private boolean charEquals(char ch1, char ch2) | |
| checkNegativeNumberExpression | back to summary |
|---|---|
| private void checkNegativeNumberExpression() Analyze the negative subpattern of DecimalFormat and set/update values as necessary. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Creates a copy of this | |
| compile | back to summary |
|---|---|
| private char[] compile(String pattern) Returns the compiled form of the given pattern. The syntax of the compiled pattern is: CompiledPattern: EntryList EntryList: Entry EntryList Entry Entry: TagField TagField data TagField: Tag Length TaggedData Tag: pattern_char_index TAG_QUOTE_CHARS Length: short_length long_length TaggedData: TAG_QUOTE_ASCII_CHAR ascii_charwhere `short_length' is an 8-bit unsigned integer between 0 and 254. `long_length' is a sequence of an 8-bit integer 255 and a 32-bit signed integer value which is split into upper and lower 16-bit fields in two char's. `pattern_char_index' is an 8-bit integer between 0 and 18. `ascii_char' is an 7-bit ASCII character value. `data' depends on its Tag value. If Length is short_length, Tag and short_length are packed in a single char, as illustrated below. char[0] = (Tag << 8) | short_length;If Length is long_length, Tag and 255 are packed in the first char and a 32-bit integer, as illustrated below. char[0] = (Tag << 8) | 255; char[1] = (char) (long_length >>> 16); char[2] = (char) (long_length & 0xffff); If Tag is a pattern_char_index, its Length is the number of pattern characters. For example, if the given pattern is "yyyy", Tag is 1 and Length is 4, followed by no data.
If Tag is TAG_QUOTE_CHARS, its Length is the number of char's
following the TagField. For example, if the given pattern is
"'o''clock'", Length is 7 followed by a char sequence of
TAG_QUOTE_ASCII_CHAR is a special tag and has an ASCII
character in place of Length. For example, if the given pattern
is "'o'", the TaggedData entry is
| |
| encode | back to summary |
|---|---|
| private static void encode(int tag, int length, StringBuilder buffer) Encodes the given tag and length and puts encoded char(s) into buffer. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Compares the specified object with this Implementation Specification This method performs an equality check with a notion of class
identity based on
| |
| format | back to summary |
|---|---|
| public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos) Implements abstract java. Formats the given
| |
| format | back to summary |
|---|---|
| pack-priv final Format. Overrides java.
| |
| format | back to summary |
|---|---|
| private Format. | |
| formatToCharacterIterator | back to summary |
|---|---|
| public AttributedCharacterIterator formatToCharacterIterator(Object obj) Overrides java. Formats an Object producing an
Each attribute key of the AttributedCharacterIterator will be of type
| |
| get2DigitYearStart | back to summary |
|---|---|
| public Date get2DigitYearStart() Returns the beginning date of the 100-year period 2-digit years are interpreted as being within.
| |
| getDateFormatSymbols | back to summary |
|---|---|
| public DateFormatSymbols getDateFormatSymbols() Gets a copy of the date and time format symbols of this date format.
| |
| getDisplayContextNamesMap | back to summary |
|---|---|
| private Map Obtains display names map, taking the context into account. Currently only the month name pattern 'M' is context dependent. | |
| getDisplayNamesMap | back to summary |
|---|---|
| private Map | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hash code value for this Implementation Specification This method calculates the hash code value using the value returned by
| |
| initialize | back to summary |
|---|---|
| private void initialize(Locale loc) | |
| initializeCalendar | back to summary |
|---|---|
| private void initializeCalendar(Locale loc) | |
| initializeDefaultCentury | back to summary |
|---|---|
| private void initializeDefaultCentury() | |
| isDigit | back to summary |
|---|---|
| private boolean isDigit(char c) | |
| matchDSTString | back to summary |
|---|---|
| private boolean matchDSTString(String text, int start, int zoneIndex, int standardIndex, String[][] zoneStrings) | |
| matchString | back to summary |
|---|---|
| private int matchString(String text, int start, int field, String[] data, CalendarBuilder calb) Private code-size reduction function used by subParse. | |
| matchString | back to summary |
|---|---|
| private int matchString(String text, int start, int field, Map<String, Integer> data, CalendarBuilder calb) Performs the same thing as matchString(String, int, int,
String[]). This method takes a Map | |
| matchZoneString | back to summary |
|---|---|
| private int matchZoneString(String text, int start, String[] zoneNames) | |
| parse | back to summary |
|---|---|
| public Date parse(String text, ParsePosition pos) Implements abstract java. Parses text from a string to produce a
The method attempts to parse text starting at the index given by
This parsing operation uses the
| |
| parseAmbiguousDatesAsAfter | back to summary |
|---|---|
| private void parseAmbiguousDatesAsAfter(Date startDate) | |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException After reading an object from the input stream, the format pattern in the object is verified.
| |
| set2DigitYearStart | back to summary |
|---|---|
| public void set2DigitYearStart(Date startDate) Sets the 100-year period 2-digit years will be interpreted as being in to begin on the date the user specifies.
| |
| setDateFormatSymbols | back to summary |
|---|---|
| public void setDateFormatSymbols(DateFormatSymbols newFormatSymbols) Sets the date and time format symbols of this date format.
| |
| shouldObeyCount | back to summary |
|---|---|
| private boolean shouldObeyCount(int tag, int count) | |
| subFormat | back to summary |
|---|---|
| private void subFormat(int patternCharIndex, int count, Format. Private member function that does the real date/time formatting. | |
| subParse | back to summary |
|---|---|
| private int subParse(String text, int start, int patternCharIndex, int count, boolean obeyCount, boolean[] ambiguousYear, ParsePosition origPos, boolean useFollowingMinusSignAsDelimiter, CalendarBuilder calb) Private member function that converts the parsed date strings into timeFields. Returns -start (for ParsePosition) if failed.
| |
| subParseNumericZone | back to summary |
|---|---|
| private int subParseNumericZone(String text, int start, int sign, int count, boolean colon, CalendarBuilder calb) Parses numeric forms of time zone offset, such as "hh:mm", and sets calb to the parsed value.
| |
| subParseZoneString | back to summary |
|---|---|
| private int subParseZoneString(String text, int start, CalendarBuilder calb) find time zone 'text' matched zoneStrings and set to internal calendar. | |
| toLocalizedPattern | back to summary |
|---|---|
| public String toLocalizedPattern() Returns a localized pattern string describing this date format.
| |
| toPattern | back to summary |
|---|---|
| public String toPattern() Returns a pattern string describing this date format.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string identifying this | |
| translatePattern | back to summary |
|---|---|
| private String translatePattern(String pattern, String from, String to) Translates a pattern, mapping each character in the from string to the corresponding character in the to string.
| |
| useDateFormatSymbols | back to summary |
|---|---|
| private boolean useDateFormatSymbols() Returns true if the DateFormatSymbols has been set explicitly or locale is null. | |
| zeroPaddingNumber | back to summary |
|---|---|
| private void zeroPaddingNumber(int value, int minDigits, int maxDigits, Format. Formats a number with the specified minimum and maximum number of digits. | |