WordPress.org

Make WordPress Core

Ticket #12885: lj-comment-datetimes.diff

File lj-comment-datetimes.diff, 654 bytes (added by kurtmckee, 4 years ago)

Adjust LiveJournal comment dates and times from GMT to local time (applies to WP 2.9.2)

  • livejournal.php

    old new  
    592592                // Get and convert the date 
    593593                preg_match( '|<date>(.*)</date>|i', $comment, $matches ); 
    594594                $comment_date = trim( str_replace( array( 'T', 'Z' ), ' ', $matches[1] ) ); 
     595                // Adjust the GMT $comment_date to the local blog time 
     596                $comment_date = date( 'Y-m-d H:i:s', ( strtotime( $comment_date ) + ( wp_timezone_override_offset() * 3600 ) ) ); 
    595597 
    596598                // Grab IP if available 
    597599                preg_match( '|<property name=\'poster_ip\'>(.*)</property>|i', $comment, $matches ); // optional