PHP | IntlCalendar getErrorCode() Function Last Updated : 25 Sep, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The IntlCalendar::getErrorCode() function is an inbuilt function in PHP which returns the numeric ICU error code for the last call on this object or the IntlCalendar given for the calendar parameter. This function can indicate a warning message (negative error code) or no error. Syntax: Object oriented style int IntlCalendar::getErrorCode( void ) Procedural style int intlcal_get_error_code( IntlCalendar $calendar ) Parameters: This function uses single parameter $calendar which holds the calendar object on the procedural style interface. Return Value: This function returns the ICU error code which indicates either success, failure or a warning message. Below program illustrates the IntlCalendar::getErrorCode() function in PHP: Program: php <?php // Set the DateTime zone ini_set('date.timezone', 'Asia/Calcutta'); // Set the intl error level ini_set("intl.error_level", E_WARNING); // Declare a DateTime object and store it into variable $calendar = IntlCalendar::fromDateTime('2019-03-21 09:19:29'); // Display the error code and message var_dump( $calendar->getErrorCode(), $calendar->getErrorMessage() ); // Declare a DateTime object and store it into variable $calendar->fieldDifference(-34E403, IntlCalendar::FIELD_ZONE_OFFSET); // Display the error code and message var_dump( $calendar->getErrorCode(), $calendar->getErrorMessage() ); ?> Output: PHP Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in /home/d0608573e6cb44f285316ff59fb833b0.php on line 19 int(0) string(12) "U_ZERO_ERROR" int(1) string(81) "intlcal_field_difference: Call to ICU method has failed: U_ILLEGAL_ARGUMENT_ERROR" Reference: https://www.php.net/manual/en/intlcalendar.geterrorcode.php Comment More infoAdvertise with us Next Article PHP | IntlDateFormatter getErrorCode() Function, J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Similar Reads PHP | IntlCalendar getErrorMessage() Function The IntlCalendar::getErrorMessage() function is an inbuilt function in PHP which is used to return the error message (if any error exist) associated with the error by using IntlCalendar::getErrorCode() or intlcal_get_error_code() function. Syntax: Object oriented style string IntlCalendar::getErrorM 1 min read PHP | IntlCalendar get() Function The IntlCalendar::get() function is an inbuilt function in PHP which is used to get the value for a specific field. Syntax: Object oriented style int IntlCalendar::get( int $field ) Procedural style int intlcal_get( IntlCalendar $cal, int $field ) Parameters: This function uses two parameters as men 2 min read PHP | IntlCalendar getTime() Function The IntlCalendar::getTime() function is an inbuilt function in PHP which is used to return the time currently represented by the object. The time is expressed in terms of milliseconds since the epoch. Syntax: Object oriented style float IntlCalendar::getTime( void ) Procedural style float intlcal_ge 1 min read PHP | IntlCalendar getType() Function The IntlCalendar::getType() function is an inbuilt function in PHP which is used to get the calendar type in terms of string. The "calendar" is the valid value of keywords. Syntax: Object oriented stylestring IntlCalendar::getType( void )Procedural stylestring intlcal_get_type( IntlCalendar $cal ) P 1 min read PHP | IntlDateFormatter getErrorCode() Function, The IntlDateFormatter::getErrorCode() function is an inbuilt function in PHP which is used to return the error code from last operation. Syntax: Object-oriented style: int IntlDateFormatter::getErrorCode( void ) Procedural style: int datefmt_get_error_code( IntlDateFormatter $fmt ) Parameters: This 1 min read PHP | IntlChar getBlockCode() Function The IntlChar::getBlockCode() function is an inbuilt function in PHP which is used to get the Unicode allocation block containing the code point. This function returns the Unicode allocation block that contains the character. Syntax: int IntlChar::getBlockCode ( $codepoint ) Parameters: This function 2 min read Like