How to change the format of Last seen: in author pane in advanced forum?
Here's what you need to use:

function YOUR_THEME_preprocess_author_pane(&amp;$variables) {
  // Get the number of seconds since last login.
  $time_since_last_login = REQUEST_TIME - $variables['account']-&gt;access;
  // Custom override of the "last_active" variable.
  //
  // This is just an example; add your rules here.
  if ($time_since_last_login &lt; 120 * 60) {
    // Show 2hr ago for any interval within last 2 hours.
    $variables['last_active'] = t('2 hours ago');
  }
  else {
    $variables['last_active'] = format_date('short', $variables['account']-&gt;access);
  }
}


Just add your custom time formatting rules.