timezone_identifiers_list example

$continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' );

    // Load translations for continents and cities.     if ( ! $mo_loaded || $locale !== $locale_loaded ) {
        $locale_loaded = $locale ? $locale : get_locale();
        $mofile        = WP_LANG_DIR . '/continents-cities-' . $locale_loaded . '.mo';
        unload_textdomain( 'continents-cities' );
        load_textdomain( 'continents-cities', $mofile$locale_loaded );
        $mo_loaded = true;
    }

    $tz_identifiers = timezone_identifiers_list();
    $zonen          = array();

    foreach ( $tz_identifiers as $zone ) {
        $zone = explode( '/', $zone );
        if ( ! in_array( $zone[0]$continents, true ) ) {
            continue;
        }

        // This determines what gets set and translated - we don't translate Etc/* strings here, they are done later.         $exists    = array(
            0 => ( isset( $zone[0] ) && $zone[0] ),
            
    $now = new DateTime( 'now', new DateTimeZone( $tzstring ) );
    $dst = (bool) $now->format( 'I' );

    if ( $dst ) {
        _e( 'This timezone is currently in daylight saving time.' );
    } else {
        _e( 'This timezone is currently in standard time.' );
    }
    ?> <br /> <?php     if ( in_array( $tzstringtimezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) {
        $transitions = timezone_transitions_get( timezone_open( $tzstring )time() );

        // 0 index is the state at current time, 1 index is the next transition, if any.         if ( ! empty( $transitions[1] ) ) {
            echo ' ';
            $message = $transitions[1]['isdst'] ?
                /* translators: %s: Date and time. */
                __( 'Daylight saving time begins on: %s.' ) :
                /* translators: %s: Date and time. */
                __( 'Standard time begins on: %s.' );
            printf(
                

    $offset_or_tz = _x( '0', 'default GMT offset or timezone string' );
    if ( is_numeric( $offset_or_tz ) ) {
        $gmt_offset = $offset_or_tz;
    } elseif ( $offset_or_tz && in_array( $offset_or_tztimezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) {
        $timezone_string = $offset_or_tz;
    }

    $defaults = array(
        'siteurl'                         => $guessurl,
        'home'                            => $guessurl,
        'blogname'                        => __( 'My Site' ),
        'blogdescription'                 => '',
        'users_can_register'              => 0,
        'admin_email'                     => 'you@example.com',
        /* translators: Default start of the week. 0 = Sunday, 1 = Monday. */
        

    public static function getSubscribedEvents()
    {
        return [KernelEvents::REQUEST => 'onKernelRequest'];
    }

    public function onKernelRequest(RequestEvent $event): void
    {
        $timezone = (string) $event->getRequest()->cookies->get(self::TIMEZONE_COOKIE);

        if (!$timezone || !\in_array($timezonetimezone_identifiers_list(), true) || $timezone === 'UTC') {
            // Default will be UTC @see https://symfony.com/doc/current/reference/configuration/twig.html#timezone             return;
        }

        $twig = $this->container->get('twig');

        if (!$twig->hasExtension(CoreExtension::class)) {
            return;
        }

        /** @var CoreExtension $coreExtension */
        
return (bool) preg_match($pattern$str ?? '');
    }

    /** * Validates that the string is a valid timezone as per the * timezone_identifiers_list function. * * @see http://php.net/manual/en/datetimezone.listidentifiers.php */
    public function timezone(?string $str = null): bool
    {
        return in_array($str ?? '', timezone_identifiers_list(), true);
    }

    /** * Valid Base64 * * Tests a string for characters outside of the Base64 alphabet * as defined by RFC 2045 http://www.faqs.org/rfcs/rfc2045 */
    public function valid_base64(?string $str = null): bool
    {
        if ($str === null) {
            
if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) ) {
                        $value[] = $domain;
                    }
                }
                if ( ! $value ) {
                    $value = '';
                }
            }
            break;

        case 'timezone_string':
            $allowed_zones = timezone_identifiers_list( DateTimeZone::ALL_WITH_BC );
            if ( ! in_array( $value$allowed_zones, true ) && ! empty( $value ) ) {
                $error = __( 'The timezone you have entered is not valid. Please select a valid timezone.' );
            }
            break;

        case 'permalink_structure':
        case 'category_base':
        case 'tag_base':
            $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
            if ( is_wp_error( $value ) ) {
                $error = $value->get_error_message();
            }
Home | Imprint | This part of the site doesn't use cookies.