I found this code
function is_old_post($days = 5) { $days = (int) $days; $offset = $days*60*60*24; if ( get_post_time() < date(\'U\') - $offset