Since: 5.5

class IntlCalendar (View source)

Constants

FIELD_ERA

FIELD_YEAR

FIELD_MONTH

FIELD_WEEK_OF_YEAR

FIELD_WEEK_OF_MONTH

FIELD_DATE

FIELD_DAY_OF_YEAR

FIELD_DAY_OF_WEEK

FIELD_DAY_OF_WEEK_IN_MONTH

FIELD_AM_PM

FIELD_HOUR

FIELD_HOUR_OF_DAY

FIELD_MINUTE

FIELD_SECOND

FIELD_MILLISECOND

FIELD_ZONE_OFFSET

FIELD_DST_OFFSET

FIELD_YEAR_WOY

FIELD_DOW_LOCAL

FIELD_EXTENDED_YEAR

FIELD_JULIAN_DAY

FIELD_MILLISECONDS_IN_DAY

FIELD_IS_LEAP_MONTH

FIELD_FIELD_COUNT

FIELD_DAY_OF_MONTH

DOW_SUNDAY

DOW_MONDAY

DOW_TUESDAY

DOW_WEDNESDAY

DOW_THURSDAY

DOW_FRIDAY

DOW_SATURDAY

DOW_TYPE_WEEKDAY

DOW_TYPE_WEEKEND

DOW_TYPE_WEEKEND_OFFSET

DOW_TYPE_WEEKEND_CEASE

WALLTIME_FIRST

WALLTIME_LAST

WALLTIME_NEXT_VALID

Methods

bool
add(int $field, int $value)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Add a (signed) amount of time to a field

bool
after(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether this object's time is after that of the passed object https://secure.php.net/manual/en/intlcalendar.after.php

bool
before(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether this object's time is before that of the passed object

bool
clear(int $field = null)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Clear a field or all fields

static IntlCalendar|null
createInstance(mixed $timezone = null, string|null $locale = null)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a new IntlCalendar

bool
equals(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Compare time of two IntlCalendar objects for equality

int|false
fieldDifference(float $timestamp, int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Calculate difference between given time and this object's time

static IntlCalendar|null
fromDateTime(mixed $datetime, $locale)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
Create an IntlCalendar from a DateTime object or string

int|false
get(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the value for a field

int|false
getActualMaximum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
The maximum value for a field, considering the object's current time

int|false
getActualMinimum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
The minimum value for a field, considering the object's current time

static array
getAvailableLocales()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get array of locales for which there is data

int|false
getDayOfWeekType(int $dayOfWeek)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Tell whether a day is a weekday, weekend or a day that has a transition between the two

int|false
getErrorCode()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error code on the object

string|false
getErrorMessage()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error message on the object

int|false
getFirstDayOfWeek()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the first day of the week for the calendar's locale

int|false
getGreatestMinimum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the largest local minimum value for a field

static IntlIterator|false
getKeywordValuesForLocale(string $keyword, string $locale, bool $onlyCommon)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get set of locale keyword values

int|false
getLeastMaximum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the smallest local maximum for a field

string|false
getLocale(int $type)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the locale associated with the object

int|false
getMaximum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the global maximum value for a field

int|false
getMinimalDaysInFirstWeek()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get minimal number of days the first week in a year or month can have

int|false
getMinimum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the global minimum value for a field

static float
getNow()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get number representing the current time

int
getRepeatedWallTimeOption()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get behavior for handling repeating wall time

int
getSkippedWallTimeOption()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get behavior for handling skipped wall time

float|false
getTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get time currently represented by the object

IntlTimeZone|false
getTimeZone()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the object's timezone

string
getType()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the calendar type

int|false
getWeekendTransition(string $dayOfWeek)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get time of the day at which weekend begins or ends

bool
inDaylightTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether the object's time is in Daylight Savings Time

bool
isEquivalentTo(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether another calendar is equal but for a different time

bool
isLenient()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether date/time interpretation is in lenient mode

bool
isWeekend(float|null $timestamp = null)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether a certain date/time is in the weekend

bool
roll(int $field, mixed $value)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Add value to field without carrying into more significant fields

bool
PS_UNRESERVE_PREFIX_isSet(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether a field is set

bool
set(int $field, int $value)

(PHP 5 >= 5.5.0 PECL intl >= 3.0.0a1)
Set a time field or several common fields at once

bool
setFirstDayOfWeek(int $dayOfWeek)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set the day on which the week is deemed to start

bool
setLenient(bool $lenient)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set whether date/time interpretation is to be lenient

bool
setRepeatedWallTimeOption(int $option)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set behavior for handling repeating wall times at negative timezone offset transitions

bool
setSkippedWallTimeOption(int $option)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set behavior for handling skipped wall times at positive timezone offset transitions

bool
setTime(float $timestamp)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set the calendar time in milliseconds since the epoch

bool
setTimeZone(mixed $timezone)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set the timezone used by this calendar

DateTime|false
toDateTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
Convert an IntlCalendar into a DateTime object

bool
setMinimalDaysInFirstWeek(int $days)

No description

void
setDate(int $year, int $month, int $dayOfMonth)

No description

void
setDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, int|null $second = null)

No description

Details

bool add(int $field, int $value)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Add a (signed) amount of time to a field

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

int $value

The signed amount to add to the current field. If the amount is positive, the instant will be moved forward; if it is negative, the instant wil be moved into the past. The unit is implicit to the field type. For instance, hours for IntlCalendar::FIELD_HOUR_OF_DAY.

Return Value

bool

Returns TRUE on success or FALSE on failure.

bool after(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether this object's time is after that of the passed object https://secure.php.net/manual/en/intlcalendar.after.php

Parameters

IntlCalendar $other

The calendar whose time will be checked against this object's time.

Return Value

bool

Returns TRUE if this object's current time is after that of the calendar argument's time. Returns FALSE otherwise. Also returns FALSE on failure. You can use https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions or https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code() to detect error conditions.

bool before(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether this object's time is before that of the passed object

Parameters

IntlCalendar $other

The calendar whose time will be checked against this object's time.

Return Value

bool

Returns TRUE if this object's current time is before that of the calendar argument's time. Returns FALSE otherwise. Also returns FALSE on failure. You can use https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions or https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code() to detect error conditions.

bool clear(int $field = null)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Clear a field or all fields

Parameters

int $field

[optional]

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

bool

Returns TRUE on success or FALSE on failure. Failure can only occur is invalid arguments are provided.

static IntlCalendar|null createInstance(mixed $timezone = null, string|null $locale = null)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a new IntlCalendar

Parameters

mixed $timezone

[optional]

The timezone to use.

  • NULL, in which case the default timezone will be used, as specified in the ini setting https://secure.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone or through the function https://secure.php.net/manual/en/function.date-default-timezone-set.php date_default_timezone_set() and as returned by https://secure.php.net/manual/en/function.date-default-timezone-get.php date_default_timezone_get().

  • An https://secure.php.net/manual/en/class.intltimezone.php IntlTimeZone, which will be used directly.

  • A https://secure.php.net/manual/en/class.datetimezone.php DateTimeZone. Its identifier will be extracted and an ICU timezone object will be created; the timezone will be backed by ICU's database, not PHP's.

  • A https://secure.php.net/manual/en/language.types.string.php string, which should be a valid ICU timezone identifier. See IntlTimeZone::createTimeZoneIDEnumeration(). Raw offsets such as "GMT+08:30" are also accepted.

string|null $locale

[optional]

A locale to use or NULL to use https://secure.php.net/manual/en/intl.configuration.php#ini.intl.default-locale the default locale.

Return Value

IntlCalendar|null

The created https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar instance or NULL on failure.

bool equals(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Compare time of two IntlCalendar objects for equality

Parameters

IntlCalendar $other

Return Value

bool

Returns TRUE if the current time of both this and the passed in https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar object are the same, or FALSE otherwise. The value FALSE can also be returned on failure. This can only happen if bad arguments are passed in. In any case, the two cases can be distinguished by calling https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code().

int|false fieldDifference(float $timestamp, int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Calculate difference between given time and this object's time

Parameters

float $timestamp

The time against which to compare the quantity represented by the field. For the result to be positive, the time given for this parameter must be ahead of the time of the object the method is being invoked on.

int $field

The field that represents the quantity being compared.

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

Returns a (signed) difference of time in the unit associated with the specified field or FALSE on failure.

static IntlCalendar|null fromDateTime(mixed $datetime, $locale)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
Create an IntlCalendar from a DateTime object or string

Parameters

mixed $datetime

A https://secure.php.net/manual/en/class.datetime.php DateTime} object or a {@link https://secure.php.net/manual/en/language.types.string.php string that can be passed to https://secure.php.net/manual/en/datetime.construct.php DateTime::__construct().

$locale [optional]

Return Value

IntlCalendar|null

The created https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar object or NULL in case of failure. If a https://secure.php.net/manual/en/language.types.string.php string is passed, any exception that occurs inside the https://secure.php.net/manual/en/class.datetime.php DateTime constructor is propagated.

int|false get(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the value for a field

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

An integer with the value of the time field.

int|false getActualMaximum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
The maximum value for a field, considering the object's current time

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

An https://secure.php.net/manual/en/language.types.integer.php int representing the maximum value in the units associated with the given field or FALSE on failure.

int|false getActualMinimum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
The minimum value for a field, considering the object's current time

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

An https://secure.php.net/manual/en/language.types.integer.php int representing the minimum value in the field's unit or FALSE on failure.

static array getAvailableLocales()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get array of locales for which there is data

Return Value

array

An array of strings, one for which locale.

int|false getDayOfWeekType(int $dayOfWeek)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Tell whether a day is a weekday, weekend or a day that has a transition between the two

Parameters

int $dayOfWeek

One of the constants IntlCalendar::DOW_SUNDAY, IntlCalendar::DOW_MONDAY, ..., IntlCalendar::DOW_SATURDAY.

Return Value

int|false

Returns one of the constants IntlCalendar::DOW_TYPE_WEEKDAY, IntlCalendar::DOW_TYPE_WEEKEND, IntlCalendar::DOW_TYPE_WEEKEND_OFFSET or IntlCalendar::DOW_TYPE_WEEKEND_CEASE or FALSE on failure.

int|false getErrorCode()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error code on the object

Return Value

int|false

An ICU error code indicating either success, failure or a warning.

string|false getErrorMessage()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error message on the object

Return Value

string|false

The error message associated with last error that occurred in a function call on this object, or a string indicating the non-existance of an error.

int|false getFirstDayOfWeek()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the first day of the week for the calendar's locale

Return Value

int|false

One of the constants IntlCalendar::DOW_SUNDAY, IntlCalendar::DOW_MONDAY, ..., IntlCalendar::DOW_SATURDAY or FALSE on failure.

int|false getGreatestMinimum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the largest local minimum value for a field

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

An https://secure.php.net/manual/en/language.types.integer.php int representing a field value, in the field's unit, or FALSE on failure.

static IntlIterator|false getKeywordValuesForLocale(string $keyword, string $locale, bool $onlyCommon)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get set of locale keyword values

Parameters

string $keyword

The locale keyword for which relevant values are to be queried. Only 'calendar' is supported.

string $locale

The locale onto which the keyword/value pair are to be appended.

bool $onlyCommon

Whether to show only the values commonly used for the specified locale.

Return Value

IntlIterator|false

An iterator that yields strings with the locale keyword values or FALSE on failure.

int|false getLeastMaximum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the smallest local maximum for a field

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

An https://secure.php.net/manual/en/language.types.integer.ph int representing a field value in the field's unit or FALSE on failure.

string|false getLocale(int $type)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the locale associated with the object

Parameters

int $type

Whether to fetch the actual locale (the locale from which the calendar data originates, with Locale::ACTUAL_LOCALE) or the valid locale, i.e., the most specific locale supported by ICU relatively to the requested locale – see Locale::VALID_LOCALE. From the most general to the most specific, the locales are ordered in this fashion – actual locale, valid locale, requested locale.

Return Value

string|false

int|false getMaximum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the global maximum value for a field

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

int|false getMinimalDaysInFirstWeek()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get minimal number of days the first week in a year or month can have

Return Value

int|false

An https://secure.php.net/manual/en/language.types.integer.php int representing a number of days or FALSE on failure.

int|false getMinimum(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the global minimum value for a field

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

int|false

An int representing a value for the given field in the field's unit or FALSE on failure.

static float getNow()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get number representing the current time

Return Value

float

A float representing a number of milliseconds since the epoch, not counting leap seconds.

int getRepeatedWallTimeOption()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get behavior for handling repeating wall time

Return Value

int

One of the constants IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST.

int getSkippedWallTimeOption()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get behavior for handling skipped wall time

Return Value

int

One of the constants IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST or IntlCalendar::WALLTIME_NEXT_VALID.

float|false getTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get time currently represented by the object

Return Value

float|false

A https://secure.php.net/manual/en/language.types.float.php float representing the number of milliseconds elapsed since the reference time (1 Jan 1970 00:00:00 UTC).

IntlTimeZone|false getTimeZone()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the object's timezone

Return Value

IntlTimeZone|false

An https://secure.php.net/manual/en/class.intltimezone.php IntlTimeZone object corresponding to the one used internally in this object.

string getType()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the calendar type

Return Value

string

A https://secure.php.net/manual/en/language.types.string.php string representing the calendar type, such as 'gregorian', 'islamic', etc.

int|false getWeekendTransition(string $dayOfWeek)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get time of the day at which weekend begins or ends

Parameters

string $dayOfWeek

One of the constants IntlCalendar::DOW_SUNDAY, IntlCalendar::DOW_MONDAY, ..., IntlCalendar::DOW_SATURDAY.

Return Value

int|false

The number of milliseconds into the day at which the the weekend begins or ends or FALSE on failure.

bool inDaylightTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether the object's time is in Daylight Savings Time

Return Value

bool

Returns TRUE if the date is in Daylight Savings Time, FALSE otherwise. The value FALSE may also be returned on failure, for instance after specifying invalid field values on non-lenient mode; use https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions or query https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code() to disambiguate.

bool isEquivalentTo(IntlCalendar $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether another calendar is equal but for a different time

Parameters

IntlCalendar $other

The other calendar against which the comparison is to be made.

Return Value

bool

Assuming there are no argument errors, returns TRUE iif the calendars are equivalent except possibly for their set time.

bool isLenient()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether date/time interpretation is in lenient mode

Return Value

bool

A https://secure.php.net/manual/en/language.types.boolean.php bool representing whether the calendar is set to lenient mode.

bool isWeekend(float|null $timestamp = null)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether a certain date/time is in the weekend

Parameters

float|null $timestamp

[optional]

An optional timestamp representing the number of milliseconds since the epoch, excluding leap seconds. If NULL, this object's current time is used instead.

Return Value

bool

A https://secure.php.net/manual/en/language.types.boolean.php bool indicating whether the given or this object's time occurs in a weekend.

The value FALSE may also be returned on failure, for instance after giving a date out of bounds on non-lenient mode; use https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions or query https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code() to disambiguate.

bool roll(int $field, mixed $value)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Add value to field without carrying into more significant fields

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar date/time https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

mixed $value

The (signed) amount to add to the field, TRUE for rolling up (adding 1), or FALSE for rolling down (subtracting 1).

Return Value

bool

Returns TRUE on success or FALSE on failure.

bool PS_UNRESERVE_PREFIX_isSet(int $field)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Whether a field is set

Parameters

int $field

One of the https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar date/time https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

Return Value

bool

Assuming there are no argument errors, returns TRUE iif the field is set.

bool set(int $field, int $value)

Since: 5.5

(PHP 5 >= 5.5.0 PECL intl >= 3.0.0a1)
Set a time field or several common fields at once

Parameters

int $field

One of the IntlCalendar date/time field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.

int $value

The new value of the given field.

Return Value

bool

Returns TRUE on success and FALSE on failure.

bool setFirstDayOfWeek(int $dayOfWeek)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set the day on which the week is deemed to start

Parameters

int $dayOfWeek

One of the constants IntlCalendar::DOW_SUNDAY, IntlCalendar::DOW_MONDAY, ..., IntlCalendar::DOW_SATURDAY.

Return Value

bool

Returns TRUE on success. Failure can only happen due to invalid parameters.

bool setLenient(bool $lenient)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set whether date/time interpretation is to be lenient

Parameters

bool $lenient

Use TRUE to activate the lenient mode; FALSE otherwise.

Return Value

bool

Returns TRUE on success. Failure can only happen due to invalid parameters.

bool setRepeatedWallTimeOption(int $option)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set behavior for handling repeating wall times at negative timezone offset transitions

Parameters

int $option

One of the constants IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST.

Return Value

bool

Returns TRUE on success. Failure can only happen due to invalid parameters.

bool setSkippedWallTimeOption(int $option)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set behavior for handling skipped wall times at positive timezone offset transitions

Parameters

int $option

One of the constants IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST or IntlCalendar::WALLTIME_NEXT_VALID.

Return Value

bool

Returns TRUE on success. Failure can only happen due to invalid parameters.

bool setTime(float $timestamp)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set the calendar time in milliseconds since the epoch

Parameters

float $timestamp

An instant represented by the number of number of milliseconds between such instant and the epoch, ignoring leap seconds.

Return Value

bool

Returns TRUE on success and FALSE on failure.

bool setTimeZone(mixed $timezone)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Set the timezone used by this calendar

Parameters

mixed $timezone

The new timezone to be used by this calendar. It can be specified in the following ways:

  • NULL, in which case the default timezone will be used, as specified in the ini setting https://secure.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone or through the function https://secure.php.net/manual/en/function.date-default-timezone-set.php date_default_timezone_set() and as returned by https://secure.php.net/manual/en/function.date-default-timezone-get.php date_default_timezone_get().

  • An https://secure.php.net/manual/en/class.intltimezone.php IntlTimeZone, which will be used directly.

  • A https://secure.php.net/manual/en/class.datetimezone.php DateTimeZone. Its identifier will be extracted and an ICU timezone object will be created; the timezone will be backed by ICU's database, not PHP's.

  • A https://secure.php.net/manual/en/language.types.string.php string, which should be a valid ICU timezone identifier. See b>IntlTimeZone::createTimeZoneIDEnumeration(). Raw offsets such as "GMT+08:30" are also accepted.

Return Value

bool

Returns TRUE on success and FALSE on failure.

DateTime|false toDateTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
Convert an IntlCalendar into a DateTime object

Return Value

DateTime|false

A https://secure.php.net/manual/en/class.datetime.php DateTime object with the same timezone as this object (though using PHP's database instead of ICU's) and the same time, except for the smaller precision (second precision instead of millisecond). Returns FALSE on failure.

bool setMinimalDaysInFirstWeek(int $days)

No description

Parameters

int $days

Return Value

bool

void setDate(int $year, int $month, int $dayOfMonth)

Since: 8.3

No description

Parameters

int $year
int $month
int $dayOfMonth

Return Value

void

void setDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, int|null $second = null)

Since: 8.3

No description

Parameters

int $year
int $month
int $dayOfMonth
int $hour
int $minute
int|null $second

Return Value

void