PHP | DateTimeZone::getName() Function Last Updated : 11 Oct, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The DateTimeZone::getName() function is an inbuilt function in PHP which is used to return the name of the created timezone. Syntax: DateTimeZone::getName() Parameters: This function does not accept any parameter. Return Values:: This function return the name of the created timezone. Below programs illustrate the DateTimeZone::getName() function: Program 1: php <?php // PHP program to illustrate DateTimeZone::getName() // function // Initialising a timezone $timeZone = "Asia/Kolkata"; // Creating DateTimeZone() object with // the above timezone $DatetimeZone = new DateTimeZone($timeZone); // Getting the name of timezone print_r($DatetimeZone->getName()); ?> Output: Asia/Kolkata Program 2: php <?php // PHP program to illustrate DateTimeZone::getName() // function // Creating DateTimeZone() object with // a specific timezone $DatetimeZone = new DateTimeZone("Asia/Singapore"); // Getting the name of timezone print_r($DatetimeZone->getName()); ?> Output: Asia/Singapore Reference https://devdocs.io/php/datetimezone.getname Comment More infoAdvertise with us Next Article PHP | DateTime modify() Function K Kanchan_Ray Follow Improve Article Tags : Web Technologies PHP PHP-date-time PHP-function Similar Reads PHP | DatePeriod getEndDate() Function The DatePeriod::getEndDate() function is an inbuilt function in PHP which is used to return the end date. If the given date period does not have any end date then it returns NULL.Syntax: DateTimeInterface DatePeriod::getEndDate( void ) Parameters: This function does not accept any parameters. Return 1 min read PHP | DateTime modify() Function The DateTime::modify() function is an inbuilt function in PHP which is used to modify or can alter the timestamp of a DateTime object. Syntax: Object oriented style: DateTime DateTime::modify( string $modify ) Procedural style: DateTime date_modify( DateTime $object, string $modify ) Parameters: Thi 2 min read PHP | date_get_last_errors() Function The date_get_last_errors() function is an inbuilt function in PHP which is used to returns the warnings and errors. This function parse a date/time string and returns an array of warnings and errors. Syntax: Procedural style: array date_get_last_errors( void ) Object oriented style: array DateTime:: 1 min read PHP | date_offset_get() Function The date_offset_get() function is an inbuilt function in PHP which is used to returns the timezone offset. This function returns the timezone offset in seconds from UTC (Universal Time Coordinated) on success or FALSE on failure. Syntax: Procedural Style: int date_offset_get( $object ) Object Orient 1 min read PHP | DateTime format() Function The DateTime::format() function is an inbuilt function in PHP which is used to return the new formatted date according to the specified format. Syntax: Object oriented style string DateTime::format( string $format ) or string DateTimeImmutable::format( string $format ) or string DateTimeInterface::f 1 min read PHP | DatePeriod getStartDate() Function The DatePeriod::getStartDate() function is an inbuilt function in PHP which is used to return the start date of the given date period. Syntax: DateTimeInterface DatePeriod::getStartDate( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the start da 1 min read Like