WordPress.org

Make WordPress Core

Changeset 5305


Ignore:
Timestamp:
04/24/2007 11:40:21 PM (14 years ago)
Author:
ryan
Message:

Use GMT in XML-RPC dateCreated fields. Props Joseph Scott. fixes #4158 for 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/xmlrpc.php

    r5289 r5305  
    203203
    204204            // Format page date.
    205             $page_date = mysql2date("Ymd\TH:i:s", $page->post_date);
     205            $page_date = mysql2date("Ymd\TH:i:s", $page->post_date_gmt);
    206206
    207207            // Pull the categories info together.
     
    424424                post_title page_title,
    425425                post_parent page_parent_id,
    426                 post_date
     426                post_date_gmt
    427427            FROM {$wpdb->posts}
    428428            WHERE post_type = 'page'
     
    433433        $num_pages = count($page_list);
    434434        for($i = 0; $i < $num_pages; $i++) {
    435             $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date);
     435            $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt);
    436436            $page_list[$i]->dateCreated = new IXR_Date($post_date);
    437437
    438             unset($page_list[$i]->post_date);
     438            unset($page_list[$i]->post_date_gmt);
    439439        }
    440440
     
    10341034        $dateCreated = $dateCreatedd->getIso();
    10351035        $post_date     = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    1036         $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
     1036        $post_date_gmt = iso8601_to_datetime($dateCreated. "Z", GMT);
    10371037      } else {
    10381038        $post_date     = current_time('mysql');
     
    12241224        $dateCreated = $dateCreatedd->getIso();
    12251225        $post_date     = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    1226         $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
     1226        $post_date_gmt = iso8601_to_datetime($dateCreated . "Z", GMT);
    12271227      } else {
    12281228        $post_date     = $postdata['post_date'];
     
    12641264      if ($postdata['post_date'] != '') {
    12651265
    1266         $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
     1266        $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
    12671267
    12681268        $categories = array();
     
    13321332        foreach ($posts_list as $entry) {
    13331333
    1334             $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
     1334            $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']);
    13351335            $categories = array();
    13361336            $catids = wp_get_post_categories($entry['ID']);
     
    15171517        foreach ($posts_list as $entry) {
    15181518
    1519             $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
     1519            $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']);
    15201520
    15211521            $struct[] = array(
Note: See TracChangeset for help on using the changeset viewer.