Converting seconds to date with Facet API I've inherited a project that deals with Drupal Facet API. I've got everything working fine, except for the display of the date for events.

The filter by date and time >> start date displays the date in seconds, however I would like this to be the date and time, e.g. Saturday 14th September 10:15 am



Here is the code from the event_system.module:

     if (isset($variables['view']) &amp;&amp; $variables['view']-&gt;name == 'events') {
    $i = $variables['view']-&gt;row_index;
    $timestamp = strtotime($variables['view']-&gt;result[$i]-&gt;field_data_field_date_and_time_field_date_and_time_value);
    $variables['post_date'] = format_date($timestamp, 'medium');
  }


I've tried this:

$variables['post_date'] = format_date($timestamp, 'custom', 'g:i a, d F, Y',0);


and this:

$variables['post_date'] = format_date('l jS F Y', strtotime($timestamp));


I've tried adding different parameters to format_date but with no success. If someone could point me in the right direction that would be great.
So it sounds like the issue is you need to convert a UNIX timestamp to a human-readable datetime?  PHP comes with the date() function which can handle this.

The first argument is the 'format' which you can find here: http://php.net/manual/en/function.date.php.  

The second argument is the UNIX timestamp--just simply pass in the timestamp variable (the # of seconds) as the second argument.