DateFormat
class DateFormat extends Format (View source)
Constants
TYPE |
Type of format object
|
Methods
Builds the DateFormat object with specified options
Shortcut method to set the value of an option and return $this.
Parses the config array by passing the values through each method to check validity against if the option exists.
Sets a quick formatting option for the date.
A custom format pattern to apply to the value, similar to the ICU date and time format.
Sets the time zone in which to display the date value.
Details
at line 51
__construct(
array $config = array())
Builds the DateFormat object with specified options
in
JsonConfig at line 64
mixed
__get(
string $option)
Get the value of a set option via magic method.
in
JsonConfig at line 75
Options
getOptions()
Gets the Options object for the JsonConfig
in
JsonConfig at line 90
JsonConfig
setOption(
string $option,
mixed $value)
Shortcut method to set the value of an option and return $this.
In order to maintain backwards compatibility, ConfigObjects will be unwrapped.
in
JsonConfig at line 106
setOptions(
array $config)
Parses the config array by passing the values through each method to check validity against if the option exists.
in
JsonConfig at line 275
array
jsonSerialize()
Custom serialization of the JsonConfig object.
in
Format at line 46
string
getType()
Returns the format type.
at line 71
DateFormat
formatType(
string $formatType)
Sets a quick formatting option for the date.
The following string values are supported, reformatting the date February 28, 2008 as shown: 'short' - Short format: e.g., "2/28/08" 'medium' - Medium format: e.g., "Feb 28, 2008" 'long' - Long format: e.g., "February 28, 2008" You cannot specify both formatType and pattern.
at line 94
DateFormat
pattern(
string $pattern)
A custom format pattern to apply to the value, similar to the ICU date and time format.
For example: "EEE, MMM d, 'yy" Also, you cannot specify both formatType and pattern.
at line 115
DateFormat
timeZone(
string $timeZone)
Sets the time zone in which to display the date value.
This is a numeric value, indicating GMT + this number of time zones (can be negative). Date object are created by default with the assumed time zone of the computer on which they are created; this option is used to display that value in a different time zone.
For example, if you created a Date object of 5pm noon on a computer located in Greenwich, England, and specified timeZone to be -5 (options['timeZone'] = -5, or Eastern Pacific Time in the US), the value displayed would be 12 noon.