Twitter-Like Time Display in WordPress

With the human_timed_diff() function show viewers a relative date in a human-readable format, like “5 minutes ago” or “one month ago”.

$diff = human_time_diff( '2012-05-05 12:05:00', '2012-05-05 12:10:00' );
echo 'This comment was submitted ' . $diff . 'ago';

// Output: This comment was submitted 5 minutes ago