Activity Stream insists on using a very non-european time standard for showing when things happen, 12hr time. I'd like to have it presented in 24HR format, as my settings in Time and Date are. See attached image for the relevant documentation of my problem.

CommentFileSizeAuthor
activity-stream.png190.68 KBpkej

Comments

akalsey’s picture

Status: Active » Closed (works as designed)

Drupal doesn't offer a time-only format, so a custom one is required to achieve the default layout. Knowing that bypassing Drupal's settings wasn't ideal, I made sure to make it easy to override the data format.

Add the code below to your template.php and change yourthemename to the name of your actual theme -- use the name of the directory it's in.

function yourthemename_activitystream_date($date) {
  $date = format_date($date, 'custom', 'g:ia');
  return $date;
}

Then change the date format to anything you'd like. You can use Drupal's short date format by doing something like this...

function yourthemename_activitystream_date($date) {
  $date = format_date($date, 'small');
  return $date;
}

Or you can use a time-only 24 hour clock like this...

function yourthemename_activitystream_date($date) {
  $date = format_date($date, 'custom', 'G:i');
  return $date;
}

See http://api.drupal.org/api/function/format_date for details about how to provide different date formats.

pkej’s picture

Thank you, I will try this.