Class DateTimeFormatter
Provides date and time localization.
The class allows you to format dates and times in a locale-sensitive manner using Unicode format patterns.
- ICanBoogie\CLDR\DateTimeFormatter implements ICanBoogie\CLDR\Formatter uses ICanBoogie\Accessor\AccessorTrait (not available)
Direct known subclasses
ICanBoogie\CLDR\DateFormatter
,
ICanBoogie\CLDR\TimeFormatter
Methods summary
protected static
array
|
|
protected
|
|
public
|
#
__construct(
Initializes the |
public
string
|
#
__invoke( mixed $datetime, string $pattern_or_width_or_skeleton )
Alias to the |
public
string
|
|
protected
string
|
#
resolve_pattern( string $pattern_or_width_or_skeleton )
Resolves the specified pattern, which can be a width, a skeleton or an actual pattern. |
protected
string
|
#
resolve_width( string $pattern_or_width_or_skeleton, string $from )
Resolves widths (full, long, medium, short) into a pattern. |
Constants summary
string |
WIDTH_FULL
|
#
'full'
|
string |
WIDTH_LONG
|
#
'long'
|
string |
WIDTH_MEDIUM
|
#
'medium'
|
string |
WIDTH_SHORT
|
#
'short'
|
Properties summary
protected static
array
|
$formatters
Pattern characters mapping to the corresponding translator methods. |
#
[
'G' => 'format_era',
'y' => 'format_year',
// 'Y' => Year (in "Week of Year" based calendars).
// 'u' => Extended year.
'Q' => 'format_quarter',
'q' => 'format_standalone_quarter',
'M' => 'format_month',
'L' => 'format_standalone_month',
// 'l' => Special symbol for Chinese leap month, used in combination with M. Only used with the Chinese calendar.
'w' => 'format_week_of_year',
'W' => 'format_week_of_month',
'd' => 'format_day_of_month',
'D' => 'format_day_of_year',
'F' => 'format_day_of_week_in_month',
'h' => 'format_hour12',
'H' => 'format_hour24',
'm' => 'format_minutes',
's' => 'format_seconds',
'E' => 'format_day_in_week',
'c' => 'format_day_in_week_stand_alone',
'e' => 'format_day_in_week_local',
'a' => 'format_period',
'k' => 'format_hour_in_day',
'K' => 'format_hour_in_period',
'z' => 'format_timezone_non_location',
'Z' => 'format_timezone_basic',
'v' => 'format_timezone_non_location'
]
|
protected
|
$calendar
The calendar used to format the datetime. |
Magic properties
public read-only
|
$calendar
The calendar used by the formatter. |