timezone_name_get()

timezone_name_get() — Alias of DateTimeZone::getName().

Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.2.0, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

timezone_name_get() is an alias of DateTimeZone::getName(): same parameters, same return value.

Signature

timezone_name_get(DateTimeZone $object): string

Parameters

ParameterTypeWhat it takes
$objectDateTimeZoneThe DateTimeZone for which to get a name.

Return value

Depending on zone type, UTC offset (type 1), timezone abbreviation (type 2), and timezone identifiers as published in the IANA timezone database (type 3), the descriptor string to create a new DateTimeZone object with the same offset and/or rules. For example 02:00, CEST, or one of the timezone names in the list of timezones.

Example

The PHP manual ships no example for timezone_name_get(); the signature and the parameter table above are the contract.

All PHP 8.5 built-in functions

Reference card built from the PHP manual page timezone_name_get() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.