PHP | IntlCalendar getType() Function Last Updated : 03 Apr, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 ) Parameters: This function accepts single parameter $cal which holds the resource of IntlCalendar. Return Value: This function returns a string value which represents the calendar type. Below program illustrates the IntlCalendar::getType() function in PHP: Program: php <?php // Set the date timezone ini_set('date.timezone', 'Asia/Calcutta'); ini_set('intl.default_locale', 'en_US'); // Create an instance of calendar $calendar = IntlCalendar::createInstance(NULL, 'en_US'); // Display the calendar type var_dump($calendar->getType()); // Create an instance of calendar $calendar = IntlCalendar::createInstance(NULL, '@calendar=islamic'); // Display the calendar type var_dump($calendar->getType()); // Create a DateTime object $calendar = IntlCalendar::fromDateTime('2019-03-21 09:19:29'); // Display the calendar type var_dump($calendar->getType()); ?> Output:string(9) "gregorian" string(7) "islamic" string(9) "gregorian" Reference: https://www.php.net/manual/en/intlcalendar.gettype.php Comment More infoAdvertise with us Next Article PHP | IntlCalendar get() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Similar Reads 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 getTimeZone() Function The IntlCalendar::getTimeZone() function is an inbuilt function in PHP which is used to return the timezone object associated with this calendar. Syntax: Object oriented style IntlTimeZone IntlCalendar::getTimeZone( void ) Procedural style IntlTimeZone intlcal_get_time_zone( IntlCalendar $cal ) Para 2 min read PHP | IntlCalendar getErrorCode() Function 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 orien 1 min read PHP | IntlCalendar inDaylightTime() Function The IntlCalendar::inDaylightTime() function is an inbuilt function in PHP which is used to check whether the object time is in Daylight Savings Time or not. Syntax: Object oriented style bool public IntlCalendar::inDaylightTime( void ) Procedural style bool intlcal_in_daylight_time( IntlCalendar $ca 1 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 Like