Create Custom Date Formatter for Date Posted Field I followed a very helpful article by Antonio Benitez that gave some example code showing how to create a custom date formatter for date fields (How To Create a Custom Format for a Date Field). The code adds an additional format option in the manage display settings page. This works great for date fields I have created (such as an event date for an event content type) but it is not applying to the existing date fields such as the node posted date. How can I make this custom formatter apply to system date fields such as the posted date, so that it appears as an option on the manage display page as well?

I am reproducing the code Antonio posted in his article here:

/**
 * Implements hook_field_formatter_info().
 */
function custom_module_field_formatter_info() {
  return array(
    'custom_date_format' =&gt; array(
      'label' =&gt; t('Custom date format'),
      'field types' =&gt; array('date', 'datestamp', 'datetime'),
      'multiple values' =&gt; FIELD_BEHAVIOR_DEFAULT,
    ),
  );
}

/**
 * Implements hook_field_formatter_view().
 */
function custom_module_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $elements = array();
  foreach ($items as $delta =&gt; $item) {
    $element = array(
      'element' =&gt; $item,
      'field' =&gt; $instance,
      'display' =&gt; $display
    );
    $elements[$delta] = array(
      '#theme' =&gt; 'custom_module_formatter_' . $display['type'],
      '#element' =&gt; $element,
      '#field' =&gt; $field,
    );
  }

  return $elements;
}

/**
 * Implements hook_theme().
 */
function custom_module_theme() {
  $themes = array(
    'custom_module_formatter_custom_date_format' =&gt; array(
      'variables' =&gt; array(
        'element' =&gt; NULL,
        'field' =&gt; NULL,
      ),
    ),
  );
  return $themes;
}

/**
 * Implements theme function
 */
function theme_custom_module_formatter_custom_date_format($vars) {
  $element = $vars['element'];
  $field = $vars['field'];

  // Configure custom date
  $format_date = 'd M';
  $timezone_bd = date_get_timezone_db($field['settings']['tz_handling']);
  $publish_date = DateTime::createFromFormat('Y-m-d H:i:s', $element['element']['value'], new DateTimeZone($timezone_bd));
  $date = format_date($publish_date-&gt;getTimestamp(), 'custom', $format_date);
  $date = explode(' ', $date);

  // Declare array for render content with custom format and tags
  $render_array = array(
    'date' =&gt; array(
      'date-day' =&gt; array(
        '#prefix' =&gt;'&lt;span class="date-day"&gt;',
        '#markup' =&gt; $date[0],
        '#suffix' =&gt; '&lt;/span&gt;'
      ),
      'date-month' =&gt; array(
        '#prefix' =&gt;'&lt;span class="date-month"&gt;',
        '#markup' =&gt; $date[1],
        '#suffix' =&gt; '&lt;/span&gt;'
      ),
    ),
    '#theme_wrapper' =&gt; array('container'),
  );

  return render($render_array['date']);
}
In Drupal 7, the created and updated "fields" on nodes (and other entities) are properties and not proper fields.  The display values for these are created in the default template_preprocess_node() provided by core, which some theme and modules may override.

Note these lines:

$variables['date'] = format_date($node-&gt;created);
...
// Display post information only on certain node types.
if (variable_get('node_submitted_' . $node-&gt;type, TRUE)) {
  $variables['display_submitted'] = TRUE;
  $variables['submitted'] = t('Submitted by !username on !datetime', array(
    '!username' =&gt; $variables['name'],
    '!datetime' =&gt; $variables['date'],
  ));
  ...
}


So, if you want to change how this is displayed, you need to implement your own template_preprocess_node() (you can do this in a theme or module), and provide your own logic.  You can either update the existing variables, which will allow the existing templates to be used, or you can add new variables and also provide your own node templates.  Typically, I do the later.