WordPress.org

Make WordPress Core

Ticket #9285: 9285_postdate.diff

File 9285_postdate.diff, 1007 bytes (added by hailin, 11 years ago)

patch

  • C:/xampp/htdocs/wordpress_trunk/wp-admin/import/wordpress.php

     
    367367
    368368                // There are only ever one of these
    369369                $post_title     = $this->get_tag( $post, 'title' );
     370               
     371                //create post_date_gmt from post_date, to retain user's perception of date while maintaining correct internal logic
    370372                $post_date      = $this->get_tag( $post, 'wp:post_date' );
    371                 $post_date_gmt  = $this->get_tag( $post, 'wp:post_date_gmt' );
     373                $gmt_tm         = strtotime( $post_date ) - get_option( 'gmt_offset' ) * 3600;
     374                $post_date_gmt  = gmdate( 'Y-m-d H:i:s', $gmt_tm );
     375               
    372376                $comment_status = $this->get_tag( $post, 'wp:comment_status' );
    373377                $ping_status    = $this->get_tag( $post, 'wp:ping_status' );
    374378                $post_status    = $this->get_tag( $post, 'wp:status' );