Skip to main content
deleted 135 characters in body
Source Link
Gulok
  • 898
  • 5
  • 12

You can use template_preprocess_node to alter submitted variable. Here is the sample code.

function awesome_preprocess_node(&$variables) {
  $variables['node'] = $variables['elements']['#node'];
  $node = $variables['node'];
  $date = format_date($node->created, 'custom', 'm-d-Y - H:i');
  $variables['name'] = theme('username', array('account' => $node));
  $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $date));
}

The most important line there is $date = format_date($node->created, 'custom', 'm-d-Y - H:i');. Change the format (m-d-Y - H:i) to any format you want.

See this page about PHP date format.

You can use template_preprocess_node to alter submitted variable. Here is the sample code.

function awesome_preprocess_node(&$variables) {
  $variables['node'] = $variables['elements']['#node'];
  $node = $variables['node'];
  $date = format_date($node->created, 'custom', 'm-d-Y - H:i');
  $variables['name'] = theme('username', array('account' => $node));
  $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $date));
}

The most important line there is $date = format_date($node->created, 'custom', 'm-d-Y - H:i');. Change the format (m-d-Y - H:i) to any format you want.

See this page about PHP date format.

You can use template_preprocess_node to alter submitted variable. Here is the sample code.

function awesome_preprocess_node(&$variables) {
  $node = $variables['node'];
  $date = format_date($node->created, 'custom', 'm-d-Y - H:i');
  $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $date));
}

The most important line there is $date = format_date($node->created, 'custom', 'm-d-Y - H:i');. Change the format (m-d-Y - H:i) to any format you want.

See this page about PHP date format.

Source Link
Gulok
  • 898
  • 5
  • 12

You can use template_preprocess_node to alter submitted variable. Here is the sample code.

function awesome_preprocess_node(&$variables) {
  $variables['node'] = $variables['elements']['#node'];
  $node = $variables['node'];
  $date = format_date($node->created, 'custom', 'm-d-Y - H:i');
  $variables['name'] = theme('username', array('account' => $node));
  $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $date));
}

The most important line there is $date = format_date($node->created, 'custom', 'm-d-Y - H:i');. Change the format (m-d-Y - H:i) to any format you want.

See this page about PHP date format.