L'errore che si commette quando si formattano le date di Twitter con PHP è quello di trascurare l'usabilità del formato scelto.
Quando il tempo trascorso dall'ultimo tweet supera un intervallo temporale facile da identificare a mente per l'utente, allora si dovrebbe specificare la data esatta secondo il principio del Don't make me think (Steve Krug):
function format_tweet_date( $t ) {
$server_time = time();
$new_tweet_time = strtotime( $t );
$this_tweet_day = date( 'd/m/Y', strtotime( $t ) );
$time = $server_time - $new_tweet_time;
if( $time < 3599 ) {
$time = round( $time / 60 ) . ' minuti fa';
} else if ( $time >= 3600 && $time <= 86400 ) {
$time = round( $time / 3600 ) . ' ore fa';
} else if ( $time > 86400 ) {
$time = $this_tweet_day;
}
return $time;
}