public static DateFormat dateFormatInstance(final String pattern)
    {
        return DateFormat.getPatternInstance(pattern, context.get().getLocale());
    }
public static DateFormat dateFormatInstance ( final String pattern ) { return DateFormat . getPatternInstance ( pattern , context . get ( ) . getLocale ( ) ) ; }
<p>
Returns an ICU based DateFormat instance for the current thread.
</p>
<p>
Date/Time format syntax:
</p>
<p>
The date/time format is specified by means of a string time pattern. In
this pattern, all ASCII letters are reserved as pattern letters, which
are defined as the following:
</p>
<style>pre { white-space: pre-wrap; white-space: -moz-pre-wrap;
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;
}</style>

<pre>
Symbol   Meaning                 Presentation        Example
------   -------                 ------------        -------
G        era designator          (Text)              AD
y        year                    (Number)            1996
Y        year (week of year)     (Number)            1997
u        extended year           (Number)            4601
U        cyclic year name        (Text,NumFallback)  ren-chen (29)
Q        Quarter                 (Text &amp; Number)     Q2 &amp; 02
M        month in year           (Text &amp; Number)     July &amp; 07
d        day in month            (Number)            10
h        hour in am/pm (1~12)    (Number)            12
H        hour in day (0~23)      (Number)            0
m        minute in hour          (Number)            30
s        second in minute        (Number)            55
S        fractional second       (Number)            978
E        day of week             (Text)              Tuesday
e        day of week (local 1~7) (Text &amp; Number)     Tues &amp; 2
D        day in year             (Number)            189
F        day of week in month    (Number)            2 (2nd Wed in July)
w        week in year            (Number)            27
W        week in month           (Number)            2
a        am/pm marker            (Text)              PM
k        hour in day (1~24)      (Number)            24
K        hour in am/pm (0~11)    (Number)            0
z        time zone               (Text)              PST
zzzz     time zone               (Text)              Pacific Standard Time
Z        time zone (RFC 822)     (Number)            -0800
ZZZZ     time zone (RFC 822)     (Text &amp; Number)     GMT-08:00
ZZZZZ    time zone (ISO 8601)    (Text &amp; Number)     -08:00 &amp; Z
v        time zone (generic)     (Text)              PT
vvvv     time zone (generic)     (Text)              Pacific Time
V        time zone (abreviation) (Text)              PST
VVVV     time zone (location)    (Text)              United States Time (Los Angeles)
g        Julian day              (Number)            2451334
A        milliseconds in day     (Number)            69540000
q        stand alone quarter     (Text &amp; Number)     Q2 &amp; 02
L        stand alone month       (Text &amp; Number)     July &amp; 07
c        stand alone day of week (Text &amp; Number)     Tuesday &amp; 2
&#39;        escape for text         (Delimiter)         &#39;Date=&#39;
&#39;&#39;       single quote            (Literal)           &#39;o&#39;&#39;clock&#39;
</pre>
<p>
The count of pattern letters determine the format.
</p>
<p>
(Text): 4 or more, use full form, &lt;4, use short or abbreviated form if
it exists. (e.g., "EEEE" produces "Monday", "EEE" produces "Mon")
</p>
<p>
(Number): the minimum number of digits. Shorter numbers are zero-padded
to this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is
handled specially; that is, if the count of 'y' is 2, the Year will be
truncated to 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces
"97".) Unlike other fields, fractional seconds are padded on the right
with zero.
</p>
<p>
(Text &amp; Number): 3 or over, use text, otherwise use number. (e.g.,
"M" produces "1", "MM" produces "01", "MMM" produces "Jan", and "MMMM"
produces "January".)
</p>
<p>
(Text,NumFallback): Behaves like Text if there is supporting data, like
Number otherwise.
</p>
<p>
Any characters in the pattern that are not in the ranges of ['a'..'z']
and ['A'..'Z'] will be treated as quoted text. For instance, characters
like ':', '.', ' ', '#' and '@' will appear in the resulting time text
even they are not embraced within single quotes.
</p>
<p>
A pattern containing any invalid pattern letter will result in a failing
UErrorCode result during formatting or parsing.
</p>
<p>
Examples using the US locale:
</p>

<pre>
Format Pattern                         Result
--------------                         -------
&quot;yyyy.MM.dd G &#39;at&#39; HH:mm:ss vvvv&quot; -&gt;&gt;  1996.07.10 AD at 15:08:56 Pacific Time
&quot;EEE, MMM d, &#39;&#39;yy&quot;                -&gt;&gt;  Wed, July 10, &#39;96
&quot;h:mm a&quot;                          -&gt;&gt;  12:08 PM
&quot;hh &#39;o&#39;&#39;clock&#39; a, zzzz&quot;           -&gt;&gt;  12 o&#39;clock PM, Pacific Daylight Time
&quot;K:mm a, vvv&quot;                     -&gt;&gt;  0:00 PM, PT
&quot;yyyyy.MMMMM.dd GGG hh:mm aaa&quot;    -&gt;&gt;  1996.July.10 AD 12:08 PM
</pre>

@param pattern
Format pattern that follows the conventions of
{@link com.ibm.icu.text.DateFormat DateFormat}
@return a DateFormat instance for the current thread