About Time conditionals

Here is how it works for me with minor changes:

  global $post;
  $post_created = strtotime($post->post_date);
  $sixMonthsAgo = strtotime('-6 months');
  $human_time="hace ". human_time_diff( get_the_time('U'), current_time('timestamp') );
  $mobile = wp_is_mobile();

  if ($post_created > $sixMonthsAgo && $mobile) {
   the_time('j. M .Y');

 } elseif( $post_created > $sixMonthsAgo && !$mobile) {
   the_time('j. F .Y');

 } else {
   echo $human_time;

 }

I hope this simplification helps 🙂