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.
Direct known subclasses
ICanBoogie\CLDR\DateFormatter
,
ICanBoogie\CLDR\TimeFormatter
Methods summary
protected static
array
|
|
public
|
#
__construct(
Initializes the |
public
mixed
|
#
__get( string $property )
Support of 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. |
public
|
#
__invoke( mixed $datetime, mixed $pattern_or_width_or_skeleton )
Alias to the |
protected
string
|
#
format_era(
Era - Replaced with the Era string for the current date. One to three letters for the abbreviated form, four letters for the long form, five for the narrow form. [1..3,4,5] |
protected
string
|
#
format_year( ICanBoogie\CLDR\Datetime $datetime, string $pattern, integer $length )
Year. Normally the length specifies the padding, but for two letters it also specifies the maximum length. [1..n] |
protected
string
|
#
format_quarter(
Quarter - Use one or two "Q" for the numerical quarter, three for the abbreviation, or four for the full (wide) name. [1..2,3,4] |
protected
string
|
#
format_standalone_quarter(
Stand-Alone Quarter - Use one or two "q" for the numerical quarter, three for the abbreviation, or four for the full (wide) name. [1..2,3,4] |
protected
string
|
#
format_month(
Month - Use one or two "M" for the numerical month, three for the abbreviation, four for the full name, or five for the narrow name. [1..2,3,4,5] |
protected
string
|
#
format_standalone_month(
Stand-Alone Month - Use one or two "L" for the numerical month, three for the abbreviation, or four for the full (wide) name, or 5 for the narrow name. [1..2,3,4,5] |
protected
integer
|
#
format_week_of_year(
Week of Year. [1..2] |
protected
integer
|
#
format_week_of_month(
Week of Month. [1] |
protected
string
|
#
format_day_of_month(
Date - Day of the month. [1..2] |
protected
string
|
#
format_day_of_year(
Day of year. [1..3] |
protected
integer
|
#
format_day_of_week_in_month(
Day of Week in Month. The example is for the 2nd Wed in July. [1] |
protected
string
|
#
format_day_in_week(
Day of week - Use one through three letters for the short day, or four for the full name, five for the narrow name, or six for the short name. [1..3,4,5,6] |
protected
string
|
|
protected
string
|
#
format_hour12(
Hour [1-12]. When used in skeleton data or in a skeleton passed in an API for flexible data pattern generation, it should match the 12-hour-cycle format preferred by the locale (h or K); it should not match a 24-hour-cycle format (H or k). Use hh for zero padding. [1..2] |
protected
string
|
#
format_hour24(
Hour [0-23]. When used in skeleton data or in a skeleton passed in an API for flexible data pattern generation, it should match the 24-hour-cycle format preferred by the locale (H or k); it should not match a 12-hour-cycle format (h or K). Use HH for zero padding. [1..2] |
protected
integer
|
#
format_hour_in_period(
Hour [0-11]. When used in a skeleton, only matches K or h, see above. Use KK for zero padding. [1..2] |
protected
integer
|
#
format_hour_in_day(
Hour [1-24]. When used in a skeleton, only matches k or H, see above. Use kk for zero padding. [1..2] |
protected
string
|
#
format_minutes(
Minute. Use one or two "m" for zero padding. |
protected
string
|
#
format_seconds(
Second. Use one or two "s" for zero padding. |
protected
string
|
Magic methods summary
Properties summary
protected static
array
|
$formatters |
#
Pattern characters mapping to the corresponding translator methods. |
protected
|
$calendar |
#
The calendar used to format the datetime. |
Magic properties
public read-only
|
$calendar |
|
#
The calendar used by the formatter. |