Defines how DateTime values are formatted and displayed, depending on the culture.
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
you may pass a CultureInfo parameter $culture to get the DateTimeFormatInfo for a specific culture.
- DateTimeFormatInfo::getInstance($culture=null);
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
- --------------------------------------------------------------------------
Located in /I18N/core/DateTimeFormatInfo.php (line 78)
Initializes a new writable instance of the DateTimeFormatInfo class
that is dependent on the ICU data for date time formatting information. N.B.You should not initialize this class directly unless you know what you are doing. Please use use DateTimeFormatInfo::getInstance() to create an instance.
Formats the date and time in a culture sensitive paterrn.
The default is "Date Time".
A one-dimensional array of type String containing the culture-specific abbreviated names of the days of the week. The array for InvariantInfo contains "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", and "Sat".
A one-dimensional array of type String containing the culture-specific abbreviated names of the months. The array for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", and "Dec".
The string designator for hours that are "ante meridiem" (before noon).
The default for InvariantInfo is "AM".
Get the AM and PM markers array.
Default InvariantInfo for AM and PM is
- array('AM','PM');
Get the internal ICU data for date time formatting.
Returns the date time order pattern, "{1} {0}" (default).
This is culture sensitive.
A one-dimensional array of type String containing the culture-specific full names of the days of the week.
The array for InvariantInfo contains "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday".
A string containing the name of the era.
Returns the full date pattern "EEEE, yyyy MMMM dd" (default).
This is culture sensitive.
Returns the full time pattern "HH:mm:ss z" (default).
This is culture sensitive.
Returns the DateTimeFormatInfo associated with the specified culture.
Gets the default DateTimeFormatInfo that is culture-independent (invariant).
Returns the long date pattern "yyyy MMMM d" (default).
This is culture sensitive.
Returns the long time pattern "HH:mm:ss z" (default).
This is culture sensitive.
Returns the medium date pattern "yyyy MMMM d" (default).
This is culture sensitive.
Returns the medium time pattern "HH:mm:ss" (default).
This is culture sensitive.
A one-dimensional array of type String containing the
culture-specific full names of the months. The array for InvariantInfo contains "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", and "December"
A one-dimensional array of type String containing the culture-specific narrow names of the days of the week. The array for InvariantInfo contains "S", "M", "T", "W", "T", "F", and "S".
A one-dimensional array of type String containing the culture-specific narrow names of the months. The array for InvariantInfo contains "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", and "D".
The string designator for hours that are "post meridiem" (after noon).
The default for InvariantInfo is "PM".
Returns the short date pattern "yy/MM/dd" (default).
This is culture sensitive.
Returns the short time pattern "HH:mm" (default).
This is culture sensitive.
Set the abbreviated day names. The value should be an array of string starting with Sunday and ends in Saturady.
For example,
- array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
Set the abbreviated month names. The value should be an array of string starting with Jan and ends in Dec.
For example,
- array("Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep","Oct","Nov","Dec");
Set the AM Designator. For example, 'AM'.
Set the AM and PM markers array.
For example
- array('AM','PM');
Set the day names. The value should be an array of string starting with Sunday and ends in Saturady.
For example,
- array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
- "Friday", "Saturday".);
Set the month names. The value should be an array of string starting with Janurary and ends in December.
For example,
- array("January", "February", "March", "April", "May", "June",
- "July", "August", "September","October","November","December");
Set the narrow day names. The value should be an array of string starting with Sunday and ends in Saturady.
For example,
- array("S", "M", "T", "W", "T", "F", "S");
Set the narrow month names. The value should be an array of string starting with J and ends in D.
For example,
- array("J","F","M","A","M","J","J","A","S","O","N","D");
Set the PM Designator. For example, 'PM'.
Allow functions that begins with 'set' to be called directly as an attribute/property to retrieve the value.
Allow functions that begins with 'set' to be called directly as an attribute/property to set the value.
Documentation generated on Sun, 04 Jun 2006 18:58:25 -0400 by phpDocumentor 1.3.0RC4