Skip to content

Instantly share code, notes, and snippets.

@jmdodd
Created October 27, 2011 04:08
Show Gist options
  • Save jmdodd/1318760 to your computer and use it in GitHub Desktop.
Save jmdodd/1318760 to your computer and use it in GitHub Desktop.
Filter tweet timestamp in Ozh' Tweet Archiver to match blog's specified GMT offset
<?php
if ( ! function_exists( 'ucc_ozh_ta_insert_tweets_post_filter' ) ) {
function ucc_ozh_ta_insert_tweets_post_filter( $postarr ) {
$offset = get_option( 'gmt_offset' ) * 3600;
$date = date( 'Y-m-d H:i:s', strtotime( $postarr['post_date'] . ' UTC' ) + $offset );
$postarr['post_date'] = $date;
return $postarr;
} }
add_filter( 'ozh_ta_insert_tweets_post', 'ucc_ozh_ta_insert_tweets_post_filter' );
/*
Copyright 2011 Jennifer M. Dodd (email: jmdodd@gmail.com)
Released under the GPLv2 (or later).
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment