Search Results
Parameters ¶ calendar An IntlCalendar instance. field One of the IntlCalendar date/time field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT. value The (signed) amount to add to the field, true for rolling up (adding 1), or false for rolling down (subtracting 1).
May 5, 2021 · The IntlCalendar::roll () function is an inbuilt function in PHP which is used to add value to field without carrying into more significant fields. The difference between IntlCalendar::roll () and IntlCalendar::add () function is that, the field value of IntlCalendar::roll () function overflow, it does not carry into more significant fields.
(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1) IntlCalendar::roll — Add value to field without carrying into more significant fields
Simple usage example of `IntlCalendar::roll ()`. The PHP function IntlCalendar::roll allows you to add a specified value to a specific field of a calendar object, without affecting the more significant fields. This function is particularly useful when you need to increment or decrement a specific part of a date or time, such as only updating the month value without affecting the year.
Output of IntlCalendar::getSkippedWallTimeOption () indicating that wall times in the skipped range should refer to the same instant as wall times with one hour after and of IntlCalendar::getRepeatedWallTimeOption () indicating the wall times in the repeated range should refer to the instant of the second occurrence of such wall time.
Additionally, the value 0 and negative values are also allowed. The value 0 encompasses the seven days that occur immediately before the first seven days of a month (which therefore have a ‘day of week in month’ with value 1). Negative values starts counting from the end of the month – -1 points to the last occurrence of a day of the week in a month, -2 to the second last, and so on.
One of the IntlCalendar date/time field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT.
