src/Common/Service/DateTime.php
public static function getCodeFromTimezone($sTimezone)
    {
        $aAbbreviations = \DateTimeZone::listAbbreviations();
        foreach ($aAbbreviations as $sCode => $aValues) {
            foreach ($aValues as $aValue) {
                if ($aValue['timezone_id'] == $sTimezone) {
                    return strtoupper($sCode);
                }
            }
        }

        return false;
    }
public static function getCodeFromTimezone($sTimezone)
    {
        $aAbbreviations = \DateTimeZone::listAbbreviations();
        foreach ($aAbbreviations as $sCode => $aValues) {
            foreach ($aValues as $aValue) {
                if ($aValue['timezone_id'] == $sTimezone) {
                    return strtoupper($sCode);
                }
            }
        }

        return false;
    }
public static function getCodeFromTimezone ( $ sTimezone ) { $ aAbbreviations = \ DateTimeZone :: listAbbreviations ( ) ; foreach ( $ aAbbreviations as $ sCode => $ aValues ) { foreach ( $ aValues as $ aValue ) { if ( $ aValue [ 'timezone_id' ] == $ sTimezone ) { return strtoupper ( $ sCode ) ; } } } return false ; }
Get the timezone code from the timezone string

@param string $sTimezone The timezone, e.g. Europe/London

@return string|false
Get the timezone code from the timezone string