Changeset 995

Show
Ignore:
Timestamp:
03/25/04 01:43:47 (5 years ago)
Author:
michelvaldrighi
Message:

now posts and edits in localtime+gmt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/post.php

    r988 r995  
    9898            $mn = ($mn > 59) ? $mn - 60 : $mn; 
    9999            $ss = ($ss > 59) ? $ss - 60 : $ss; 
    100         $now = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss"); 
     100        $now = date("$aa-$mm-$jj $hh:$mn:$ss"); 
     101        $now_gmt = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss"); 
    101102        } else { 
    102         $now = gmdate('Y-m-d H:i:s'); 
     103        $now = current_time('mysql'); 
     104        $now_gmt = current_time('mysql', 1); 
    103105        } 
    104106 
     
    128130        if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { 
    129131        $postquery ="INSERT INTO $tableposts 
    130                 (ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping) 
     132                (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping) 
    131133                VALUES 
    132                 ('0', '$user_ID', '$now', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback') 
     134                ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback') 
    133135                "; 
    134136        } else { 
    135137        $postquery ="INSERT INTO $tableposts 
    136                 (ID, post_author, post_date, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping) 
     138                (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping) 
    137139                VALUES 
    138                 ('0', '$user_ID', '$now', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback') 
     140                ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback') 
    139141                "; 
    140142        } 
     
    323325            $mn = ($mn > 59) ? $mn - 60 : $mn; 
    324326            $ss = ($ss > 59) ? $ss - 60 : $ss; 
    325             $datemodif = ", post_date = '".get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss")."'"; 
     327            $datemodif = ", post_date = '$aa-$mm-$jj $hh:$mn:$ss'"; 
     328        $datemodif_gmt = ", post_date = '".get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss")."'"; 
    326329        } else { 
    327330            $datemodif = ''; 
    328         } 
    329      
    330     $now = gmdate('Y-m-d H:i:s'); 
     331            $datemodif_gmt = ''; 
     332        } 
     333     
     334    $now = current_time('mysql'); 
     335    $now_gmt = current_time('mysql', 1); 
    331336 
    332337        $result = $wpdb->query(" 
     
    344349                to_ping = '$trackback', 
    345350                post_modified = '$now' 
     351                post_modified_gmt = '$now_gmt' 
    346352            WHERE ID = $post_ID "); 
    347353