human_time_difference()
will not work here as it returns a string in a human readable form. However, we can use some of the logic used there to construct a workable function
You can try the following: (Untested)
function get_custom__time_diff()
{
global $post;
// Get the current time
$current_time = time();
// Get the post date
$post_date = get_the_time( 'U', $post );
// Get the amount of seconds in 5 hours
$test_time = 5*HOUR_IN_SECONDS;
$diff = $current_time - $post_date;
if ( $diff < $test_time )
return 'New';
return '';
}
You can then call it as follow inside the loop
echo get_custom__time_diff();