DateFormat
class DateFormat extends Format (View source)
Constants
TYPE |
|
Properties
string | $formatType | A quick formatting option for the date. | |
string | $pattern | Format string, as a subset of the ICU pattern set. | |
string | $timeZone | timeZone to assign to values in the visualization. |
Methods
Builds the NumberFormat object with specified options
Same as toArray, but without the class name as a key to being multi-dimension.
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 57
mixed
__construct(
array $config = array())
Builds the NumberFormat object with specified options
in
Format at line 79
array
getValues()
Same as toArray, but without the class name as a key to being multi-dimension.
in
Format at line 97
string
toJson()
Returns a JSON string representation of the object's properties.
at line 78
DateFormat
formatType(
string $ft)
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 109
DateFormat
pattern(
string $p)
A custom format pattern to apply to the value, similar to the ICU date and time format.
For example: new DateFormat({pattern: "EEE, MMM d, ''yy"});
You cannot specify both formatType and pattern.
at line 139
DateFormat
timeZone(
string $tz)
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.