[wp-trac] [WordPress Trac] #3034: Livejournal import adjusts time incorrectly for posts, but not comments

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 15 13:00:08 GMT 2006


#3034: Livejournal import adjusts time incorrectly for posts, but not comments
----------------------------+-----------------------------------------------
 Reporter:  dustyakubra     |       Owner:  anonymous                     
     Type:  defect          |      Status:  new                           
 Priority:  low             |   Milestone:                                
Component:  Administration  |     Version:  2.0.4                         
 Severity:  minor           |    Keywords:  import, livejounnal, timezone,
----------------------------+-----------------------------------------------
 The livejournal import uses gmdate() on post times but date() on comment
 times. For me, my server configuration made all the posts appear to be 4
 hours later, although the comments appeared to be at the right time.

 Here's the code for importing post times:
 {{{
 preg_match('|<eventtime>(.*?)</eventtime>|is', $post, $post_date);
 $post_date = strtotime($post_date[1]);
 $post_date = gmdate('Y-m-d H:i:s', $post_date);
 }}}
 And for comments:
 {{{
 preg_match('|<eventtime>(.*?)</eventtime>|is', $comment, $comment_date);
 $comment_date = trim($comment_date[1]);
 $comment_date = date('Y-m-d H:i:s', strtotime($comment_date));
 }}}

 It seems silly to do this two different ways. For my configuration, I
 simply changed the code for importing post times to:
 {{{
 preg_match('|<eventtime>(.*?)</eventtime>|is', $post, $post_date);
 $post_date = trim($post_date[1]);
 $post_date = date('Y-m-d H:i:s', strtotime($post_date));
 }}}
 Looking at it, the trim() doesn't seem necessary either, as there was
 nothing to trim on my <eventtime>s for either the posts or the comments.

 By the way, it seems to me that livejournal's export feature doesn't even
 allow the exporting of comments (and their associated metadata.) I
 personally downloaded my livejournal using
 [http://fawx.com/software/ljarchive/ ljarchive] which AFAIK doesn't edit
 the xml at all.. but yeah.

 Also, I'm not sure which component this belongs in - is there a page
 describing the components? (similar to bugzilla's describecomponents.cgi)
 .. you see, is Administration about the admin control panel for wordpress,
 or is it about general administration elements of the wordpress project?
 *puzzled*

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3034>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list