How can I format the date like this in search-result.tpl? In node.tpl I have

&lt;div class="imported-text"&gt;

Created on &lt;?php print date('l', $node-&gt;created); ?&gt;, the &lt;?php print date('jS', $node-&gt;created); ?&gt; of &lt;?php print date('F Y', $node-&gt;created); ?&gt;.

&lt;/div&gt;


But when I place this in search-result.tpl I get an error. &lt;?php print $info_split['date'] ?&gt; can only use the short format AFAIK.
I find it is generally best to do things in a consistent way and since the drupal template_preprocess_search_result() function uses Drupal's format_date() function I recommend also using that when overriding things.

So to leave the date in the default info variable but change the format I would do this, in my template.php file of my theme (or a custom module, depending on my requirements):

/**
 * Variable preprocessor for the search result template.
 *
 * @see search-result.tpl.php
 */
function MODULE_OR_THEME_NAME_preprocess_search_result(&amp;$variables) {
  $result = $variables['result'];

  // Override the date format.
  if (!empty($result['date'])) {
    $variables['info_split']['date'] = format_date($result['date'], 'custom', 'l, \t\h\e jS \o\f F Y');
  }
  // Reset the info variable based on the new date.
  $variables['info'] = implode(' - ', $variables['info_split']);
}


If I wanted a date variable available in my template that was separate from the info variable I would do this:

/**
 * Variable preprocessor for the search result template.
 *
 * @see search-result.tpl.php
 */
function MODULE_OR_THEME_NAME_preprocess_search_result(&amp;$variables) {
  $result = $variables['result'];

  // Add a custom date variable for use in the template.
  $variables['custom_date'] = '';
  if (!empty($result['date'])) {
    $variables['custom_date'] = format_date($result['date'], 'custom', 'l, \t\h\e jS \o\f F Y');
  }
}


Then to use that variable in the template file you would do something like this:

&lt;?php if ($custom_date): ?&gt;
  &lt;div class="date"&gt;
    &lt;php print $custom_date; ?&gt;
  &lt;/div&gt;
&lt;?php endif; ?&gt;


Something I recommend to make things even a bit better again is instead of using the 'custom' date formatter, make a preset for "l, \t\h\e jS \o\f F Y" in the Drupal UI at admin/config/regional/date-time, then use that preset like this:

format_date($result['date'], 'preset_name');


Then you can easily change the format in future via the UI.

In this case I would recommend calling the preset "Search result date" or something along those lines so that you know what it is used for when looking the the UI and you know what will be affected if you change it.