How to create a dynamic date format?
I think the best solution is used custom field formatter for date type:

/**
 * Implements hook_field_formatter_info().
 */
function mymodule_field_formatter_info() {
  return array(
      'mymodule_custom_datestamp' =&gt; array(
          'label' =&gt; t('Custom datestamp formatter'),
          'field types' =&gt; array('datestamp'), 
      ),
      'mymodule_custom_date' =&gt; array(
          'label' =&gt; t('Custom date formatter'),
          'field types' =&gt; array('date', 'datetime'), 
      ),
  );
}

/**
 * Implements hook_field_formatter_view().
 */
function mymodule_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();

  switch ($display['type']) {
    case 'mymodule_custom_datestamp':
      foreach ($items as $delta =&gt; $item) {
        $tmp = (integer)$item['value'];
        $minutes = (integer)date('i', $tmp);
        if(empty($minutes)){ //you'll update only values with :00
          $element[$delta] = array('#markup' =&gt; date('l, F d, Y - h a', $tmp));
        }else{
          $element[$delta] = array('#markup' =&gt; date('l, F d, Y - h:i a', $tmp));
        }
      }
      break;
    case 'mymodule_custom_date':
          .....
          break;
  }

  return $element;
}


You can use it anywhere and It uses the least resources.