Using time remaining, ongoing for event titles

When you use the dynamic display block module to showcase events and want to show how long till the events starts or show ongoing if the event is happening at this time you can do the following:

Add a date field to CCK with a start date and an end date. Add this field to the view you use and use the following code to make the title in the content preprocess function:

    // add slide_title variable
    if (isset($result->node_title)) {
      date_default_timezone_set('Europe/London');
      $vars['slider_item']['slide_title'] =  $result->node_title .
      '<br />' .
      theme_date_time_ago(date_create($result->node_data_field_pager_item_text_field_startdate_value), date_create($result->node_data_field_pager_item_text_field_startdate_value2));
    }