DateFormat class.
The DateFormat class allows you to format dates and times with predefined styles in a locale-sensitive manner. Formatting times with the DateFormat class is similar to formatting dates.
Formatting dates with the DateFormat class is a two-step process. First, you create a formatter with the getDateInstance method. Second, you invoke the format method, which returns a string containing the formatted date.
DateTime values are formatted using standard or custom patterns stored in the properties of a DateTimeFormatInfo.
Located in /I18N/core/DateFormat.php (line 48)
The DateTimeFormatInfo, containing culture specific patterns and names.
A list of methods, to be used by the token function calls.
A list of tokens and their function call.
Initialize a new DateFormat.
Format a date according to the pattern.
Get the AM/PM designator, 12 noon is PM, 12 midnight is AM.
Get the day of the month.
"d" for non-padding, "dd" will always return 2 characters.
Get day in the month.
Get the day of the week.
"E" will return integer 0 (for Sunday) through 6 (for Saturday). "EE" will return the narrow day of the week, e.g. "M" "EEE" will return the abrreviated day of the week, e.g. "Mon" "EEEE" will return the day of the week, e.g. "Monday"
Get the day in the year, e.g. [1-366]
Get the era. i.e. in gregorian, year > 0 is AD, else BC.
For a particular token, get the corresponding function to call.
Get the hours in 12 hour format.
"h" for non-padding, "hh" will always return 2 characters.
Get the hours in 24 hour format, i.e. [0-23].
"H" for non-padding, "HH" will always return 2 characters.
Get the hours in AM/PM format, e.g [1-12]
Get the hours [1-24].
Get the minutes.
"m" for non-padding, "mm" will always return 2 characters.
Get the month.
"M" will return integer 1 through 12 "MM" will return the narrow month name, e.g. "J" "MMM" will return the abrreviated month name, e.g. "Jan" "MMMM" will return the month name, e.g. "January"
Get the pattern from DateTimeFormatInfo or some predefined patterns.
If the $pattern parameter is an array of 2 element, it will assume that the first element is the date, and second the time and try to find an appropriate pattern and apply DateTimeFormatInfo::formatDateTime See the tutorial documentation for futher details on the patterns.
Get the seconds.
"s" for non-padding, "ss" will always return 2 characters.
Get the timezone from the server machine.
Tokenize the pattern. The tokens are delimited by group of similar characters, e.g. 'aabb' will form 2 tokens of 'aa' and 'bb'.
Any substrings, starting and ending with a single quote (') will be treated as a single token.
Get week in the month.
Get the week in the year.
Get the year.
"yy" will return the last two digits of year. "yyyy" will return the full integer year.
Documentation generated on Sun, 04 Jun 2006 18:58:24 -0400 by phpDocumentor 1.3.0RC4