# RFC: TimeZone::getWindowsID

- Status: Implemented (PHP 7.1)
- Authors: Sara Golemon, pollita@php.net
- Date: 2016-03-15
- Version: 1.0
- Original: https://wiki.php.net/rfc/intl.timezone.get-windows-id
- Page: https://externals.io/rfc/intl.timezone.get-windows-id
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

## Votes

### Approve get-windows-id RFC and merge oatch into master? (closed)

Yes: 27 · No: 0

Voters: colinodell (Yes), derick (Yes), galvao (Yes), kalle (Yes), klaussilveira (Yes), krakjoe (Yes), leigh (Yes), lstrojny (Yes), mariano (Yes), mattwil (Yes), mbeccati (Yes), mike (Yes), mrook (Yes), ocramius (Yes), pajoye (Yes), patrickallaert (Yes), pauloelr (Yes), pierrick (Yes), pollita (Yes), sammyk (Yes), sebastian (Yes), stas (Yes), svpernova09 (Yes), trowski (Yes), yohgaki (Yes), yunosh (Yes), zimt (Yes)

## Discussions on the mailing list

- [\[RFC\] Add IntlTimeZone::getWindowsID() and IntlTimeZone::getIDForWindowsID() to ext/intl](https://externals.io/message/91687.md) — started on 2016-03-16, 7 messages
- [\[VOTE\] IntlTimeZone::getWindowsID() and getIDForWindowsID()](https://externals.io/message/92058.md) — started on 2016-04-01, 3 messages

---

## Introduction

ICU adds new methods from time to time. Specifically, the methods [TimeZone::getWindowsID](http://icu-project.org/apiref/icu4c/classicu_1_1TimeZone.html#a216766958df6b1931bb7603ae78d114e) and [TimeZone::getIDForWindowsID](http://icu-project.org/apiref/icu4c/classicu_1_1TimeZone.html#a0872f72c5c3204de3c61502be568d72d) were added with ICU4C 52.

## Proposal

Add support for these two new methods as static methods on the PHP IntlTimeZone class using the following prototypes:

```
class IntlTimeZone {
  /* Converts a system timezone such as "America/Los_Angeles" to a
   * Windows Timezone identifier.
  * 
   * @param string $systemID - System Timezone Identifier, such as "America/Los_Angeles"
   * @returns string - Windows Timezone Identifier, i.e. "Pacific Standard Time", or FALSE on failure
  */
  public static function getWindowsID(string $systemID): string;
  
  /* Convers a windows timezone identier such as "Pacific Time Zone" to a
   * System Timezone identifier appropriate to the region requested.
   * .
   * @param string $windowsID - Windows Timezone identifier, such as "Pacific TimeZone"
   * @param string $region - Preferred region for result, or NULL for no preference
   * @returns string - System Timezone identifier, i.e. "America/Los_Angeles", or FALSE on failure
  */
  public static function getIDForWindowsID(string $windowsID, ?string $region = NULL): string;
}

function intltz_get_windows_id($id) { return IntlTimeZone::getWindowsID($id); }
function intltz_get_id_for_windows_id($winid, $region = NULL) { return IntlTimeZone::getIDForWindowsID($winid, $region); }
```

## Proposed PHP Version(s)

PHP 7.1

## Vote

Simple 50% +1 majority: “Should this APIs be added to IntlTimeZone?”

**Vote: Approve get-windows-id RFC and merge oatch into master?** — Yes: 27 · No: 0 (closed)

## Patches and Tests

<https://github.com/php/php-src/compare/master...sgolemon:intl.timezone.52-updates>

## Commits

<https://github.com/php/php-src/commit/a9568d54858912cd741df183f8eee2493361de7f>
