IntlDateFormatter
class IntlDateFormatter (View source)
Constants
FULL |
Completely specified style (Tuesday, April 12, 1952 AD or 3:30:42pm PST) |
LONG |
Long style (January 12, 1952 or 3:30:32pm) |
MEDIUM |
Medium style (Jan 12, 1952) |
SHORT |
Most abbreviated style, only essential data (12/13/52 or 3:30pm) |
NONE |
Do not include this element |
GREGORIAN |
Gregorian Calendar |
TRADITIONAL |
Non-Gregorian Calendar |
RELATIVE_FULL |
|
RELATIVE_LONG |
|
RELATIVE_MEDIUM |
|
RELATIVE_SHORT |
|
PATTERN |
|
Methods
No description
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Create a date formatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the datetype used for the IntlDateFormatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the timetype used for the IntlDateFormatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the calendar used for the IntlDateFormatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
sets the calendar used to the appropriate calendar, which must be
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the timezone-id used for the IntlDateFormatter
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Get copy of formatter's calendar object
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Get formatter's timezone
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Sets the time zone to use
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Sets formatter's timezone
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Set the pattern used for the IntlDateFormatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the pattern used for the IntlDateFormatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the locale used by formatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Set the leniency of the parser
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the lenient used for the IntlDateFormatter
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Format the date/time value as a string
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Formats an object
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Parse string to a timestamp value
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Parse string to a field-based time value
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the error code from last operation
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the error text from the last operation.
No description
Details
__construct(string|null $locale, int $dateType = 0, int $timeType = 0, mixed|null $timezone = null, mixed|null $calendar = null, string $pattern = null)
No description
static IntlDateFormatter|null
create(string $locale, int $dateType = 0, int $timeType = 0, string $timezone = null, int $calendar = null, string $pattern = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Create a date formatter
int|false
getDateType()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the datetype used for the IntlDateFormatter
int|false
getTimeType()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the timetype used for the IntlDateFormatter
int|false
getCalendar()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the calendar used for the IntlDateFormatter
bool
setCalendar(int $calendar)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
sets the calendar used to the appropriate calendar, which must be
string|false
getTimeZoneId()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the timezone-id used for the IntlDateFormatter
IntlCalendar|false|null
getCalendarObject()
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Get copy of formatter's calendar object
IntlTimeZone|false
getTimeZone()
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Get formatter's timezone
bool
setTimeZoneId(string $zone)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Sets the time zone to use
bool|null
setTimeZone(mixed $timezone)
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Sets formatter's timezone
bool
setPattern(string $pattern)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Set the pattern used for the IntlDateFormatter
string|false
getPattern()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the pattern used for the IntlDateFormatter
string|false
getLocale(int $type = 0)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the locale used by formatter
void
setLenient(bool $lenient)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Set the leniency of the parser
bool
isLenient()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the lenient used for the IntlDateFormatter
string|false
format(mixed $datetime, $array = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Format the date/time value as a string
static string|false
formatObject(object $datetime, mixed $format = null, string|null $locale = null)
(PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
Formats an object
int|float|false
parse(string $string, int $offset = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Parse string to a timestamp value
array|false
localtime(string $string, int $offset = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Parse string to a field-based time value
int
getErrorCode()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the error code from last operation
string
getErrorMessage()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Get the error text from the last operation.
int|float|false
parseToCalendar(string $string, $offset = null)
No description