date_i18n example

 elseif ( empty( $saved ) ) {
            $response['wp_autosave'] = array(
                'success' => false,
                'message' => __( 'Error while saving.' ),
            );
        } else {
            /* translators: Draft saved date format, see https://www.php.net/manual/datetime.format.php */
            $draft_saved_date_format = __( 'g:i:s a' );
            $response['wp_autosave'] = array(
                'success' => true,
                /* translators: %s: Date and time. */
                'message' => sprintf( __( 'Draft saved at %s.' )date_i18n( $draft_saved_date_format ) ),
            );
        }
    }

    return $response;
}

/** * Removes single-use URL parameters and create canonical link based on new URL. * * Removes specific query string parameters from a URL, create the canonical link, * put it in the admin header, and change the current URL to match. * * @since 4.2.0 */
<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br /> <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label> </fieldset> </div><!-- .misc-pub-section --> <div class="misc-pub-section curtime misc-pub-curtime"> <?php $submitted = sprintf(
    /* translators: 1: Comment date, 2: Comment time. */
    __( '%1$s at %2$s' ),
    /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
    date_i18n( _x( 'M j, Y', 'publish box date format' )strtotime( $comment->comment_date ) ),
    /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
    date_i18n( _x( 'H:i', 'publish box time format' )strtotime( $comment->comment_date ) )
);
?> <span id="timestamp"> <?php /* translators: %s: Comment date. */
printf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' );
?> </span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text">
' <a href="%1$s">%2$s</a>',
        esc_url( $permalink ),
        __( 'View page' )
    );

}

$scheduled_date = sprintf(
    /* translators: Publish box date string. 1: Date, 2: Time. */
    __( '%1$s at %2$s' ),
    /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
    date_i18n( _x( 'M j, Y', 'publish box date format' )strtotime( $post->post_date ) ),
    /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
    date_i18n( _x( 'H:i', 'publish box time format' )strtotime( $post->post_date ) )
);

$messages['post']       = array(
    0  => '', // Unused. Messages start at index 1.     1  => __( 'Post updated.' ) . $view_post_link_html,
    2  => __( 'Custom field updated.' ),
    3  => __( 'Custom field deleted.' ),
    4  => __( 'Post updated.' ),
    /* translators: %s: Date and time of the revision. */
    
if ( empty( $timestamp ) ) {
            return '';
        }

        $time_diff = time() - $timestamp;

        if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
            /* translators: %s: Human-readable time difference. */
            return sprintf( __( '%s ago' )human_time_diff( $timestamp ) );
        }

        return date_i18n( get_option( 'date_format' )$timestamp );
    }

    /** * Handles the default column. * * @since 4.9.6 * @since 5.7.0 Added `manage_{$this->screen->id}_custom_column` action. * * @param WP_User_Request $item Item being shown. * @param string $column_name Name of column being shown. */
    
if ( $current && isset( $current->last_checked ) ) {
        $last_update_check = $current->last_checked + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
    }

    echo '<h2 class="wp-current-version">';
    /* translators: Current version of WordPress. */
    printf( __( 'Current version: %s' )get_bloginfo( 'version' ) );
    echo '</h2>';

    echo '<p class="update-last-checked">';
    /* translators: 1: Date, 2: Time. */
    printf( __( 'Last checked on %1$s at %2$s.' )date_i18n( __( 'F j, Y' )$last_update_check )date_i18n( __( 'g:i a T' )$last_update_check ) );
    echo ' <a href="' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '">' . __( 'Check again.' ) . '</a>';
    echo '</p>';

    if ( current_user_can( 'update_core' ) ) {
        core_auto_updates_settings();
        core_upgrade_preamble();
    }
    if ( current_user_can( 'update_plugins' ) ) {
        list_plugin_updates();
    }
    if ( current_user_can( 'update_themes' ) ) {
        
$summary = substr( $summary, 0, -5 ) . '[&hellip;]';
            }

            $summary = '<div class="rssSummary">' . esc_html( $summary ) . '</div>';
        }

        $date = '';
        if ( $show_date ) {
            $date = $item->get_date( 'U' );

            if ( $date ) {
                $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' )$date ) . '</span>';
            }
        }

        $author = '';
        if ( $show_author ) {
            $author = $item->get_author();
            if ( is_object( $author ) ) {
                $author = $author->get_name();
                $author = ' <cite>' . esc_html( strip_tags( $author ) ) . '</cite>';
            }
        }

        


    wp_send_json_error();
}

/** * Handles formatting a date via AJAX. * * @since 3.1.0 */
function wp_ajax_date_format() {
    wp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['date'] ) ) ) );
}

/** * Handles formatting a time via AJAX. * * @since 3.1.0 */
function wp_ajax_time_format() {
    wp_die( date_i18n( sanitize_option( 'time_format', wp_unslash( $_POST['date'] ) ) ) );
}

if ( isset( $response_body['events'] ) ) {
            foreach ( $response_body['events'] as $key => $event ) {
                $timestamp = strtotime( $event['date'] );

                /* * The `date_format` option is not used because it's important * in this context to keep the day of the week in the formatted date, * so that users can tell at a glance if the event is on a day they * are available, without having to open the link. */
                /* translators: Date format for upcoming events on the dashboard. Include the day of the week. See https://www.php.net/manual/datetime.format.php */
                $formatted_date = date_i18n( __( 'l, M j, Y' )$timestamp );
                $formatted_time = date_i18n( get_option( 'time_format' )$timestamp );

                if ( isset( $event['end_date'] ) ) {
                    $end_timestamp      = strtotime( $event['end_date'] );
                    $formatted_end_date = date_i18n( __( 'l, M j, Y' )$end_timestamp );

                    if ( 'meetup' !== $event['type'] && $formatted_end_date !== $formatted_date ) {
                        /* translators: Upcoming events month format. See https://www.php.net/manual/datetime.format.php */
                        $start_month = date_i18n( _x( 'F', 'upcoming events month format' )$timestamp );
                        $end_month   = date_i18n( _x( 'F', 'upcoming events month format' )$end_timestamp );

                        
$results = $wpdb->get_results( $query );
            wp_cache_set( $key$results, 'post-queries' );
        }
        $arc_w_last = '';
        if ( $results ) {
            $after = $parsed_args['after'];
            foreach ( (array) $results as $result ) {
                if ( $result->week != $arc_w_last ) {
                    $arc_year       = $result->yr;
                    $arc_w_last     = $result->week;
                    $arc_week       = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) );
                    $arc_week_start = date_i18n( get_option( 'date_format' )$arc_week['start'] );
                    $arc_week_end   = date_i18n( get_option( 'date_format' )$arc_week['end'] );
                    $url            = add_query_arg(
                        array(
                            'm' => $arc_year,
                            'w' => $result->week,
                        ),
                        home_url( '/' )
                    );
                    if ( 'post' !== $parsed_args['post_type'] ) {
                        $url = add_query_arg( 'post_type', $parsed_args['post_type']$url );
                    }
                    
$content_array = self::get_suggested_policy_text();
        $content       = '';
        $date_format   = __( 'F j, Y' );

        foreach ( $content_array as $section ) {
            $class   = '';
            $meta    = '';
            $removed = '';

            if ( ! empty( $section['removed'] ) ) {
                $badge_class = ' red';
                $date        = date_i18n( $date_format$section['removed'] );
                /* translators: %s: Date of plugin deactivation. */
                $badge_title = sprintf( __( 'Removed %s.' )$date );

                /* translators: %s: Date of plugin deactivation. */
                $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
                $removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed$date ) . '</p></div>';
            } elseif ( ! empty( $section['updated'] ) ) {
                $badge_class = ' blue';
                $date        = date_i18n( $date_format$section['updated'] );
                /* translators: %s: Date of privacy policy text update. */
                $badge_title = sprintf( __( 'Updated %s.' )$date );
            }
$title = "<a href='{$link}'>{$title}</a>";
        }
        $title = "<div class='wp-block-rss__item-title'>{$title}</div>";

        $date = '';
        if ( $attributes['displayDate'] ) {
            $date = $item->get_date( 'U' );

            if ( $date ) {
                $date = sprintf(
                    '<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ',
                    esc_attr( date_i18n( 'c', $date ) ),
                    esc_attr( date_i18n( get_option( 'date_format' )$date ) )
                );
            }
        }

        $author = '';
        if ( $attributes['displayAuthor'] ) {
            $author = $item->get_author();
            if ( is_object( $author ) ) {
                $author = $author->get_name();
                $author = '<span class="wp-block-rss__item-author">' . sprintf(
                    
/** * Handles the created column output. * * @since 5.6.0 * * @param array $item The current application password item. */
    public function column_created( $item ) {
        if ( empty( $item['created'] ) ) {
            echo '&mdash;';
        } else {
            echo date_i18n( __( 'F j, Y' )$item['created'] );
        }
    }

    /** * Handles the last used column output. * * @since 5.6.0 * * @param array $item The current application password item. */
    public function column_last_used( $item ) {
        
'ua'         => __( 'User Agent' ),
            'login'      => __( 'Last Login' ),
        );

        foreach ( $session_tokens as $token_key => $session_token ) {
            $session_tokens_data_to_export = array();

            foreach ( $session_tokens_props_to_export as $key => $name ) {
                if ( ! empty( $session_token[ $key ] ) ) {
                    $value = $session_token[ $key ];
                    if ( in_array( $key, array( 'expiration', 'login' ), true ) ) {
                        $value = date_i18n( 'F d, Y H:i A', $value );
                    }
                    $session_tokens_data_to_export[] = array(
                        'name'  => $name,
                        'value' => $value,
                    );
                }
            }

            $data_to_export[] = array(
                'group_id'          => 'session-tokens',
                'group_label'       => __( 'Session Tokens' ),
                
if ( ! in_array( $revision->post_type, array( 'post', 'page', 'revision' ), true ) ) {
        return false;
    }

    /* translators: Revision date format, see https://www.php.net/manual/datetime.format.php */
    $datef = _x( 'F j, Y @ H:i:s', 'revision date format' );
    /* translators: %s: Revision date. */
    $autosavef = __( '%s [Autosave]' );
    /* translators: %s: Revision date. */
    $currentf = __( '%s [Current Revision]' );

    $date      = date_i18n( $datefstrtotime( $revision->post_modified ) );
    $edit_link = get_edit_post_link( $revision->ID );
    if ( $link && current_user_can( 'edit_post', $revision->ID ) && $edit_link ) {
        $date = "<a href='$edit_link'>$date</a>";
    }

    if ( ! wp_is_post_revision( $revision ) ) {
        $date = sprintf( $currentf$date );
    } elseif ( wp_is_post_autosave( $revision ) ) {
        $date = sprintf( $autosavef$date );
    }

    
 elseif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified.                 $stamp = __( 'Publish <b>immediately</b>' );
            } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified.                 /* translators: Post date information. %s: Date on which the post is to be published. */
                $stamp = __( 'Schedule for: %s' );
            } else { // Draft, 1 or more saves, date specified.                 /* translators: Post date information. %s: Date on which the post is to be published. */
                $stamp = __( 'Publish on: %s' );
            }
            $date = sprintf(
                $date_string,
                date_i18n( $date_formatstrtotime( $post->post_date ) ),
                date_i18n( $time_formatstrtotime( $post->post_date ) )
            );
        } else { // Draft (no saves, and thus no date specified).             $stamp = __( 'Publish <b>immediately</b>' );
            $date  = sprintf(
                $date_string,
                date_i18n( $date_formatstrtotime( current_time( 'mysql' ) ) ),
                date_i18n( $time_formatstrtotime( current_time( 'mysql' ) ) )
            );
        }

        
Home | Imprint | This part of the site doesn't use cookies.