PHP | IntlCalendar isSet() Function Last Updated : 25 Sep, 2019 Comments Improve Suggest changes Like Article Like Report The IntlCalendar::isSet() function is an inbuilt function in PHP which is used to check whether a given field is set or not. This function is opposite to IntlCalendar::clear() function. Syntax: Object oriented style bool IntlCalendar::isSet( int $field ) Procedural style bool intlcal_is_set( IntlCalendar $cal, int $field ) Parameters: This function uses two parameters as mentioned above and described below: $cal: This parameter holds the resource of IntlCalendar object. $field: This parameter holds one of the IntlCalendar date/time field constants. The value of field constants are integer and lies between 0 to IntlCalendar::FIELD_COUNT. Return Value: This function returns TRUE if the field is set and returns error if the field is not set. Below program illustrates the IntlCalendar::isSet() function in PHP: Program: php <?php // Set the DateTime zone ini_set('date.timezone', 'Asia/Calcutta'); // Create an instance of IntlCalendar $calendar = IntlCalendar::createInstance('Asia/Calcutta'); // Check month field is set or not var_dump($calendar->isSet(IntlCalendar::FIELD_MONTH)); // Set the DateTime to the object $calendar->set(2019, 8, 29); // Check for month field var_dump($calendar->isSet(IntlCalendar::FIELD_MONTH)); // Set the DateTime object $calendar->set(strtotime('2019-09-22 12:30:00')); // Check for year field var_dump($calendar->isSet(IntlCalendar::FIELD_YEAR)); ?> Output: bool(true) bool(true) bool(true) Reference: https://www.php.net/manual/en/intlcalendar.isset.php Comment More infoAdvertise with us Next Article PHP | IntlCalendar isSet() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Similar Reads PHP | IntlCalendar isWeekend() Function The IntlCalendar::isWeekend() function is an inbuilt function in PHP which is used to check whether a given date/time is in the weekend or not. Syntax: Object oriented style bool IntlCalendar::isWeekend( float $date = NULL ) Procedural style bool intlcal_is_weekend( IntlCalendar $cal, float $date = 1 min read PHP | IntlCalendar isEquivalentTo() Function The IntlCalendar::isEquivalentTo() function is an inbuilt function in PHP which is used to check whether the given calendar is equal but for a different time. Syntax: Object oriented style bool IntlCalendar::isEquivalentTo( IntlCalendar $other ) Procedural style bool intlcal_is_equivalent_to( IntlCa 1 min read PHP IntlChar::isbase() Function PHP IntlChar::isbase() function is an inbuilt function in PHP that is used to check whether the given input data is a base character or not. If the specified code point is a base character then it returns TRUE for general categories "L" (Letters), "N" (numbers), "Mc" (spacing combining marks), and " 2 min read PHP | IntlCalendar set() Function The IntlCalendar::set() function is an inbuilt function in PHP which is used to set the time field or several common fields at once. The range of field value depends on the calendar. This function can not be called with exactly four parameters. Syntax: Object oriented style bool IntlCalendar::set( i 2 min read PHP | IntlCalendar add() Function The IntlCalendar::add() function is an inbuilt function in PHP which is used to add a signed amount of time to a field. Syntax: Object oriented style: bool IntlCalendar::add( int $field, int $amount ) Procedural style: bool intlcal_add( IntlCalendar $cal, int $field, int $amount ) Parameters: $cal: 2 min read Like