Livejournal import adjusts time incorrectly for posts, but not comments
|Reported by:||dustyakubra||Owned by:||rob1n|
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); $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); $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); $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 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*
Change History (6)
- Keywords has-patch added; import, livejounnal, timezone, removed
- Priority changed from low to normal
- Severity changed from minor to normal