timezone_name_from_abbr
Returns a timezone name by guessing from abbreviation and UTC offset.
timezone_name_from_abbr Function synopsis
timezone_name_from_abbr(
string $abbr,
int $utcOffset = -1,
int $isDST = -1
): string|false
Parameters
$abbr
Typestring
Time zone abbreviation.
$utcOffset
OptionalTypeintDefault value-1
Offset from GMT in seconds. Defaults to -1 which means that first found
time zone corresponding to $abbr is returned.
Otherwise exact offset is searched and only if not found then the first
time zone with any offset is returned.
$isDST
OptionalTypeintDefault value-1
Daylight saving time indicator. Defaults to -1, which means that
whether the time zone has daylight saving or not is not taken into
consideration when searching. If this is set to 1, then the
$utcOffset is assumed to be an offset with
daylight saving in effect; if 0, then $utcOffset
is assumed to be an offset without daylight saving in effect. If
$abbr doesn't exist then the time zone is
searched solely by the $utcOffset and
$isDST.
Return value
Typestring|false
Returns time zone name on success or false on failure.
Changes to the timezone_name_from_abbr Function
PHP 8.0
- Return type added:
string|false - Parameter type added for parameter #1 (
$abbr):string - Parameter name of parameter #2 changed:
$gmtoffsetto$utcOffset - Parameter type added for parameter #2 (
$utcOffset):int - Parameter default value added for position #2 (
$utcOffset):-1 - Parameter name of parameter #3 changed:
$isdstto$isDST - Parameter type added for parameter #3 (
$isDST):int - Parameter default value added for position #3 (
$isDST):-1
timezone_name_from_abbr(
- $abbr,
+ string $abbr,
- $gmtoffset,
+ int $utcOffset = -1,
- $isdst
+ int $isDST = -1
- )
+ ): string|false timezone_name_from_abbr Function Availability
timezone_name_from_abbr Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |