This class contains information, such as date patterns, time patterns,
and AM/PM designators.
To create a DateTimeFormatInfo for a specific culture, create a
CultureInfo for that culture and retrieve the CultureInfo.DateTimeFormat
property. For example:
$culture = new CultureInfo('en_AU');
$dtfi = $culture->DateTimeFormat;
To create a DateTimeFormatInfo for the invariant culture, use
DateTimeFormatInfo::getInstance($culture=null);
you may pass a CultureInfo parameter $culture to get the DateTimeFormatInfo
for a specific culture.
DateTime values are formatted using standard or custom patterns stored in
the properties of a DateTimeFormatInfo.
The standard patterns can be replaced with custom patterns by setting the
associated properties of DateTimeFormatInfo.
The following table lists the standard format characters for each standard
pattern and the associated DateTimeFormatInfo property that can be set to
modify the standard pattern. The format characters are case-sensitive;
for example, 'g' and 'G' represent slightly different patterns.
Format Character Associated Property Example Format Pattern (en-US)
--------------------------------------------------------------------------
d ShortDatePattern MM/dd/yyyy
D LongDatePattern dddd, dd MMMM yyyy
F FullDateTimePattern dddd, dd MMMM yyyy HH:mm:ss
m, M MonthDayPattern MMMM dd
r, R RFC1123Pattern ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
s SortableDateTimePattern yyyy'-'MM'-'dd'T'HH':'mm':'ss
t ShortTimePattern HH:mm
T LongTimePattern HH:mm:ss
Y YearMonthPattern yyyy MMMM
--------------------------------------------------------------------------