touch_time

The timeline below displays how wordpress function touch_time has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Prints out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale $wp_locale WordPress date and time locale object.
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending'), true) && (!$post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // @todo Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : current_time('d');
    $mm = $edit ? mysql2date('m', $post_date, false) : current_time('m');
    $aa = $edit ? mysql2date('Y', $post_date, false) : current_time('Y');
    $hh = $edit ? mysql2date('H', $post_date, false) : current_time('H');
    $mn = $edit ? mysql2date('i', $post_date, false) : current_time('i');
    $ss = $edit ? mysql2date('s', $post_date, false) : current_time('s');
    $cur_jj = current_time('d');
    $cur_mm = current_time('m');
    $cur_aa = current_time('Y');
    $cur_hh = current_time('H');
    $cur_mn = current_time('i');
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select class="form-required" ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    printf(__('%1$s %2$s, %3$s at %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 5.6

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale $wp_locale WordPress date and time locale object.
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending'), true) && (!$post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // @todo Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : current_time('d');
    $mm = $edit ? mysql2date('m', $post_date, false) : current_time('m');
    $aa = $edit ? mysql2date('Y', $post_date, false) : current_time('Y');
    $hh = $edit ? mysql2date('H', $post_date, false) : current_time('H');
    $mn = $edit ? mysql2date('i', $post_date, false) : current_time('i');
    $ss = $edit ? mysql2date('s', $post_date, false) : current_time('s');
    $cur_jj = current_time('d');
    $cur_mm = current_time('m');
    $cur_aa = current_time('Y');
    $cur_hh = current_time('H');
    $cur_mn = current_time('i');
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select class="form-required" ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    printf(__('%1$s %2$s, %3$s at %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 5.5

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale $wp_locale WordPress date and time locale object.
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending'), true) && (!$post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // @todo Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : current_time('d');
    $mm = $edit ? mysql2date('m', $post_date, false) : current_time('m');
    $aa = $edit ? mysql2date('Y', $post_date, false) : current_time('Y');
    $hh = $edit ? mysql2date('H', $post_date, false) : current_time('H');
    $mn = $edit ? mysql2date('i', $post_date, false) : current_time('i');
    $ss = $edit ? mysql2date('s', $post_date, false) : current_time('s');
    $cur_jj = current_time('d');
    $cur_mm = current_time('m');
    $cur_aa = current_time('Y');
    $cur_hh = current_time('H');
    $cur_mn = current_time('i');
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    printf(__('%1$s %2$s, %3$s at %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 5.4

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale $wp_locale WordPress date and time locale object.
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // @todo Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : current_time('d');
    $mm = $edit ? mysql2date('m', $post_date, false) : current_time('m');
    $aa = $edit ? mysql2date('Y', $post_date, false) : current_time('Y');
    $hh = $edit ? mysql2date('H', $post_date, false) : current_time('H');
    $mn = $edit ? mysql2date('i', $post_date, false) : current_time('i');
    $ss = $edit ? mysql2date('s', $post_date, false) : current_time('s');
    $cur_jj = current_time('d');
    $cur_mm = current_time('m');
    $cur_aa = current_time('Y');
    $cur_hh = current_time('H');
    $cur_mn = current_time('i');
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    printf(__('%1$s %2$s, %3$s at %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 5.3

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale $wp_locale WordPress date and time locale object.
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : current_time('d');
    $mm = $edit ? mysql2date('m', $post_date, false) : current_time('m');
    $aa = $edit ? mysql2date('Y', $post_date, false) : current_time('Y');
    $hh = $edit ? mysql2date('H', $post_date, false) : current_time('H');
    $mn = $edit ? mysql2date('i', $post_date, false) : current_time('i');
    $ss = $edit ? mysql2date('s', $post_date, false) : current_time('s');
    $cur_jj = current_time('d');
    $cur_mm = current_time('m');
    $cur_aa = current_time('Y');
    $cur_hh = current_time('H');
    $cur_mn = current_time('i');
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    printf(__('%1$s %2$s, %3$s at %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 5.2

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale  $wp_locale
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : current_time('d');
    $mm = $edit ? mysql2date('m', $post_date, false) : current_time('m');
    $aa = $edit ? mysql2date('Y', $post_date, false) : current_time('Y');
    $hh = $edit ? mysql2date('H', $post_date, false) : current_time('H');
    $mn = $edit ? mysql2date('i', $post_date, false) : current_time('i');
    $ss = $edit ? mysql2date('s', $post_date, false) : current_time('s');
    $cur_jj = current_time('d');
    $cur_mm = current_time('m');
    $cur_aa = current_time('Y');
    $cur_hh = current_time('H');
    $cur_mn = current_time('i');
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 5.1

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale  $wp_locale
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
	<?php 
}

WordPress Version: 4.4

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
 *
 * @global WP_Locale  $wp_locale
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : get_comment()->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 4.3

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 *
 * @global WP_Locale $wp_locale
 * @global object    $comment
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = '<label><span class="screen-reader-text">' . __('Month') . '</span><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext) . "</option>\n";
    }
    $month .= '</select></label>';
    $day = '<label><span class="screen-reader-text">' . __('Day') . '</span><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $year = '<label><span class="screen-reader-text">' . __('Year') . '</span><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $hour = '<label><span class="screen-reader-text">' . __('Hour') . '</span><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    $minute = '<label><span class="screen-reader-text">' . __('Minute') . '</span><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s:%5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 4.2

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int      $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = '<label for="mm" class="screen-reader-text">' . __('Month') . '</label><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $wp_locale->get_month_abbrev($wp_locale->get_month($i))) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<label for="jj" class="screen-reader-text">' . __('Day') . '</label><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $year = '<label for="aa" class="screen-reader-text">' . __('Year') . '</label><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    $hour = '<label for="hh" class="screen-reader-text">' . __('Hour') . '</label><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $minute = '<label for="mn" class="screen-reader-text">' . __('Minute') . '</label><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 4.1

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 *
 * @param int $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int $tab_index The tabindex attribute to add. Default 0.
 * @param int $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = '<label for="mm" class="screen-reader-text">' . __('Month') . '</label><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $wp_locale->get_month_abbrev($wp_locale->get_month($i))) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<label for="jj" class="screen-reader-text">' . __('Day') . '</label><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $year = '<label for="aa" class="screen-reader-text">' . __('Year') . '</label><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    $hour = '<label for="hh" class="screen-reader-text">' . __('Hour') . '</label><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $minute = '<label for="mn" class="screen-reader-text">' . __('Minute') . '</label><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 4.0

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int|bool $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // todo: Remove this?
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = '<label for="mm" class="screen-reader-text">' . __('Month') . '</label><select ' . ($multi ? '' : 'id="mm" ') . 'name="mm"' . $tab_index_attribute . ">\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $wp_locale->get_month_abbrev($wp_locale->get_month($i))) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<label for="jj" class="screen-reader-text">' . __('Day') . '</label><input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $year = '<label for="aa" class="screen-reader-text">' . __('Year') . '</label><input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    $hour = '<label for="hh" class="screen-reader-text">' . __('Hour') . '</label><input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $minute = '<label for="mn" class="screen-reader-text">' . __('Minute') . '</label><input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    $map = array('mm' => array($mm, $cur_mm), 'jj' => array($jj, $cur_jj), 'aa' => array($aa, $cur_aa), 'hh' => array($hh, $cur_hh), 'mn' => array($mn, $cur_mn));
    foreach ($map as $timeunit => $value) {
        list($unit, $curr) = $value;
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 3.9

/**
 * Print out HTML form date elements for editing post or comment publish date.
 *
 * @since 0.71
 *
 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
 * @param int|bool $tab_index The tabindex attribute to add. Default 0.
 * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
 *                            Default 0|false.
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = "<select " . ($multi ? '' : 'id="mm" ') . "name=\"mm\"{$tab_index_attribute}>\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected($monthnum, $mm, false) . '>';
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= sprintf(__('%1$s-%2$s'), $monthnum, $wp_locale->get_month_abbrev($wp_locale->get_month($i))) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $year = '<input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    $hour = '<input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $minute = '<input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    foreach (array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit) {
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . ${$timeunit} . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . ${$cur_timeunit} . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 3.8

/**
 * {@internal Missing Short Description}}
 *
 * @since 0.71
 *
 * @param unknown_type $edit
 * @param unknown_type $for_post
 * @param unknown_type $tab_index
 * @param unknown_type $multi
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = "<select " . ($multi ? '' : 'id="mm" ') . "name=\"mm\"{$tab_index_attribute}>\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '"';
        if ($i == $mm) {
            $month .= ' selected="selected"';
        }
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= '>' . sprintf(__('%1$s-%2$s'), $monthnum, $wp_locale->get_month_abbrev($wp_locale->get_month($i))) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $year = '<input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    $hour = '<input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $minute = '<input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    foreach (array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit) {
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . ${$timeunit} . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . ${$cur_timeunit} . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}

WordPress Version: 3.7

/**
 * {@internal Missing Short Description}}
 *
 * @since 0.71
 *
 * @param unknown_type $edit
 * @param unknown_type $for_post
 * @param unknown_type $tab_index
 * @param unknown_type $multi
 */
function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)
{
    global $wp_locale, $comment;
    $post = get_post();
    if ($for_post) {
        $edit = !(in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
    $time_adj = current_time('timestamp');
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
    $cur_jj = gmdate('d', $time_adj);
    $cur_mm = gmdate('m', $time_adj);
    $cur_aa = gmdate('Y', $time_adj);
    $cur_hh = gmdate('H', $time_adj);
    $cur_mn = gmdate('i', $time_adj);
    $month = "<select " . ($multi ? '' : 'id="mm" ') . "name=\"mm\"{$tab_index_attribute}>\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '"';
        if ($i == $mm) {
            $month .= ' selected="selected"';
        }
        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
        $month .= '>' . sprintf(__('%1$s-%2$s'), $monthnum, $wp_locale->get_month_abbrev($wp_locale->get_month($i))) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<input type="text" ' . ($multi ? '' : 'id="jj" ') . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $year = '<input type="text" ' . ($multi ? '' : 'id="aa" ') . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    $hour = '<input type="text" ' . ($multi ? '' : 'id="hh" ') . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    $minute = '<input type="text" ' . ($multi ? '' : 'id="mn" ') . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    echo '<div class="timestamp-wrap">';
    /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    printf(__('%1$s %2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    if ($multi) {
        return;
    }
    echo "\n\n";
    foreach (array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit) {
        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . ${$timeunit} . '" />' . "\n";
        $cur_timeunit = 'cur_' . $timeunit;
        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . ${$cur_timeunit} . '" />' . "\n";
    }
    ?>

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php 
    _e('OK');
    ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js"><?php 
    _e('Cancel');
    ?></a>
</p>
<?php 
}