PHP RFC: IntlTimeZone::getWindowsID()


ICU adds new methods from time to time. Specifically, the methods TimeZone::getWindowsID and TimeZone::getIDForWindowsID were added with ICU4C 52.


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


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

Approve get-windows-id RFC and merge oatch into master?
Real name Yes No
colinodell (colinodell)  
derick (derick)  
galvao (galvao)  
kalle (kalle)  
klaussilveira (klaussilveira)  
krakjoe (krakjoe)  
leigh (leigh)  
lstrojny (lstrojny)  
mariano (mariano)  
mattwil (mattwil)  
mbeccati (mbeccati)  
mike (mike)  
mrook (mrook)  
ocramius (ocramius)  
pajoye (pajoye)  
patrickallaert (patrickallaert)  
pauloelr (pauloelr)  
pierrick (pierrick)  
pollita (pollita)  
sammyk (sammyk)  
sebastian (sebastian)  
stas (stas)  
svpernova09 (svpernova09)  
trowski (trowski)  
yohgaki (yohgaki)  
yunosh (yunosh)  
zimt (zimt)  
Final result: 27 0
This poll has been closed.

Patches and Tests


rfc/intl.timezone.get-windows-id.txt · Last modified: 2017/09/22 13:28 by