# iso8601_timezone_to_offset()

URL: https://chugunov.pro/api-wordpress/functions/iso8601_timezone_to_offset/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 1.5.0.

## Сигнатура

```php
iso8601_timezone_to_offset( string $timezone ): int|float
```

## Описание

По часовому поясу в формате ISO 8601 возвращает его смещение относительно UTC в секундах.

## Параметры

- `$timezone` `string` — обязательный. Либо 'Z' для нулевого смещения, либо '±hhmm'.

## Возвращаемое значение

`int|float`

## Исходный код

Файл: `wp-includes/formatting.php:3710`

```php
function iso8601_timezone_to_offset( $timezone ) {
	// $timezone is either 'Z' or '[+|-]hhmm'.
	if ( 'Z' === $timezone ) {
		$offset = 0;
	} else {
		$sign    = ( str_starts_with( $timezone, '+' ) ) ? 1 : -1;
		$hours   = (int) substr( $timezone, 1, 2 );
		$minutes = (int) substr( $timezone, 3, 4 ) / 60;
		$offset  = $sign * HOUR_IN_SECONDS * ( $hours + $minutes );
	}
	return $offset;
}
```

## История изменений

- 1.5.0 — Introduced.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/iso8601_timezone_to_offset/
