PHP | IntlCalendar getTimeZone() Function Last Updated : 25 Sep, 2019 Comments Improve Suggest changes Like Article Like Report 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 ) Parameters: This function accepts single parameter $cal which holds the resource of IntlCalendar object. Return Value: This function returns an IntlTimeZone object associated with this calendar. Below program illustrates the IntlCalendar::getTimeZone() 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(); // Get the object of timezone print_r($calendar->getTimeZone()); // Create new IntlGregorianCalendar object $calendar->setTimezone(new DateTimeZone('Asia/Singapore')); // Get the object of timezone print_r($calendar->getTimeZone()); // Set the timezone $calendar->setTimeZone('GMT+05:30'); // Get the object of timezone print_r($calendar->getTimeZone()); // Set the timezone $calendar->setTimeZone(IntlTimeZone::getGMT()); // Get the object of timezone print_r($calendar->getTimeZone()); ?> Output: IntlTimeZone Object ( [valid] => 1 [id] => Asia/Calcutta [rawOffset] => 19800000 [currentOffset] => 19800000 ) IntlTimeZone Object ( [valid] => 1 [id] => Asia/Singapore [rawOffset] => 28800000 [currentOffset] => 28800000 ) IntlTimeZone Object ( [valid] => 1 [id] => GMT+05:30 [rawOffset] => 19800000 [currentOffset] => 19800000 ) IntlTimeZone Object ( [valid] => 1 [id] => GMT [rawOffset] => 0 [currentOffset] => 0 ) Reference: https://www.php.net/manual/en/intlcalendar.gettimezone.php Comment More infoAdvertise with us Next Article PHP | IntlCalendar getTimeZone() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Similar Reads 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 | 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 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 Like