WordPress.org

Make WordPress Core

Changeset 5888


Ignore:
Timestamp:
08/17/2007 03:18:58 AM (12 years ago)
Author:
markjaquith
Message:

Send dateCreated as local blog time, add date_created_gmt with GMT value. Props josephscott. fixes #4624. refs #4158, #4314

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r5825 r5888  
    209209
    210210            // Format page date.
    211             $page_date = mysql2date("Ymd\TH:i:s\Z", $page->post_date_gmt);
     211            $page_date = mysql2date("Ymd\TH:i:s", $page->post_date);
     212            $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt);
    212213
    213214            // Pull the categories info together.
     
    241242                "wp_page_order"         => $page->menu_order,
    242243                "wp_author_id"          => $author->ID,
    243                 "wp_author_display_name"    => $author->display_name
     244                "wp_author_display_name"    => $author->display_name,
     245                "date_created_gmt"      => new IXR_Date($page_date_gmt)
    244246            );
    245247
     
    430432                post_title page_title,
    431433                post_parent page_parent_id,
    432                 post_date_gmt
     434                post_date_gmt,
     435                post_date
    433436            FROM {$wpdb->posts}
    434437            WHERE post_type = 'page'
     
    439442        $num_pages = count($page_list);
    440443        for($i = 0; $i < $num_pages; $i++) {
    441             $post_date = mysql2date("Ymd\TH:i:s\Z", $page_list[$i]->post_date_gmt);
     444            $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date);
     445            $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt);
     446
    442447            $page_list[$i]->dateCreated = new IXR_Date($post_date);
     448            $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt);
    443449
    444450            unset($page_list[$i]->post_date_gmt);
     451            unset($page_list[$i]->post_date);
    445452        }
    446453
     
    10551062        $to_ping = implode(' ', $to_ping);
    10561063
    1057       // Do some timestamp voodoo
    1058       $dateCreatedd = $content_struct['dateCreated'];
    1059       if (!empty($dateCreatedd)) {
    1060         $dateCreated = $dateCreatedd->getIso();
    1061         $post_date    = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    1062         $post_date_gmt = iso8601_to_datetime($dateCreated. "Z", GMT);
    1063       } else {
    1064         $post_date    = current_time('mysql');
    1065         $post_date_gmt = current_time('mysql', 1);
    1066       }
     1064        // Do some timestamp voodoo
     1065        $dateCreatedd = $content_struct['dateCreated'];
     1066        if (!empty($dateCreatedd)) {
     1067            $dateCreated = $dateCreatedd->getIso();
     1068            $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
     1069            $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
     1070        } else {
     1071            $post_date = current_time('mysql');
     1072            $post_date_gmt = current_time('mysql', 1);
     1073        }
    10671074
    10681075      $catnames = $content_struct['categories'];
     
    13421349      if ($postdata['post_date'] != '') {
    13431350
    1344         $post_date = mysql2date('Ymd\TH:i:s\Z', $postdata['post_date_gmt']);
     1351        $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
     1352        $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
    13451353
    13461354        $categories = array();
     
    13771385          'wp_password' => $postdata['post_password'],
    13781386          'wp_author_id' => $author->ID,
    1379           'wp_author_display_name'  => $author->display_name
     1387          'wp_author_display_name'  => $author->display_name,
     1388          'date_created_gmt' => new IXR_Date($post_date_gmt)
    13801389        );
    13811390
     
    14101419        foreach ($posts_list as $entry) {
    14111420
    1412             $post_date = mysql2date('Ymd\TH:i:s\Z', $entry['post_date_gmt']);
     1421            $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
     1422            $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']);
     1423
    14131424            $categories = array();
    14141425            $catids = wp_get_post_categories($entry['ID']);
     
    14441455                'wp_password' => $entry['post_password'],
    14451456                'wp_author_id' => $author->ID,
    1446                 'wp_author_display_name' => $author->display_name
     1457                'wp_author_display_name' => $author->display_name,
     1458                'date_created_gmt' => new IXR_Date($post_date_gmt)
    14471459            );
    14481460
     
    15941606        foreach ($posts_list as $entry) {
    15951607
    1596             $post_date = mysql2date('Ymd\TH:i:s\Z', $entry['post_date_gmt']);
     1608            $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
     1609            $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']);
    15971610
    15981611            $struct[] = array(
     
    16011614                'postid' => $entry['ID'],
    16021615                'title' => $entry['post_title'],
     1616                'date_created_gmt' => new IXR_Date($post_date_gmt)
    16031617            );
    16041618
Note: See TracChangeset for help on using the changeset viewer.