Make WordPress Core

Changeset 12590


Ignore:
Timestamp:
12/30/2009 05:56:09 PM (15 years ago)
Author:
ryan
Message:

Use current_time() to calculate current time. Props filosofo. fixes #10915

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r12540 r12590  
    26112611    // 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 />';
    26122612
    2613     $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
     2613    $time_adj = current_time('timestamp');
    26142614    $post_date = ($for_post) ? $post->post_date : $comment->comment_date;
    26152615    $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
  • trunk/wp-includes/general-template.php

    r12587 r12590  
    11241124        $newrow = false;
    11251125
    1126         if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) )
     1126        if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
    11271127            echo '<td id="today">';
    11281128        else
  • trunk/wp-includes/link-template.php

    r12588 r12590  
    290290    global $wp_rewrite;
    291291    if ( !$year )
    292         $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
     292        $year = gmdate('Y', current_time('timestamp'));
    293293    $yearlink = $wp_rewrite->get_year_permastruct();
    294294    if ( !empty($yearlink) ) {
     
    312312    global $wp_rewrite;
    313313    if ( !$year )
    314         $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
     314        $year = gmdate('Y', current_time('timestamp'));
    315315    if ( !$month )
    316         $month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
     316        $month = gmdate('m', current_time('timestamp'));
    317317    $monthlink = $wp_rewrite->get_month_permastruct();
    318318    if ( !empty($monthlink) ) {
     
    338338    global $wp_rewrite;
    339339    if ( !$year )
    340         $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
     340        $year = gmdate('Y', current_time('timestamp'));
    341341    if ( !$month )
    342         $month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
     342        $month = gmdate('m', current_time('timestamp'));
    343343    if ( !$day )
    344         $day = gmdate('j', time()+(get_option('gmt_offset') * 3600));
     344        $day = gmdate('j', current_time('timestamp'));
    345345
    346346    $daylink = $wp_rewrite->get_day_permastruct();
Note: See TracChangeset for help on using the changeset viewer.