Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1270
diff -u -p -r1.1270 common.inc
--- includes/common.inc	8 Dec 2010 07:06:27 -0000	1.1270
+++ includes/common.inc	9 Dec 2010 23:53:20 -0000
@@ -1868,30 +1868,10 @@ function format_date($timestamp, $type =
     $langcode = isset($language->language) ? $language->language : 'en';
   }
 
-  switch ($type) {
-    case 'short':
-      $format = variable_get('date_format_short', 'm/d/Y - H:i');
-      break;
-
-    case 'long':
-      $format = variable_get('date_format_long', 'l, F j, Y - H:i');
-      break;
-
-    case 'custom':
-      // No change to format.
-      break;
-
-    case 'medium':
-    default:
-      // Retrieve the format of the custom $type passed.
-      if ($type != 'medium') {
-        $format = variable_get('date_format_' . $type, '');
-      }
-      // Fall back to 'medium'.
-      if ($format === '') {
-        $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
-      }
-      break;
+  $format = variable_get("date_format_$type", NULL);
+  if (empty($format)) {
+    $formats = system_get_date_formats($type);
+    $format = array_shift($formats);
   }
 
   // Create a DateTime object from the timestamp.
Index: includes/date.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/date.inc,v
retrieving revision 1.2
diff -u -p -r1.2 date.inc
--- includes/date.inc	9 Dec 2010 01:51:15 -0000	1.2
+++ includes/date.inc	9 Dec 2010 23:53:20 -0000
@@ -15,11 +15,6 @@ function system_default_date_formats() {
   // Short date formats.
   $formats[] = array(
     'type' => 'short',
-    'format' => 'Y-m-d H:i',
-    'locales' => array(),
-  );
-  $formats[] = array(
-    'type' => 'short',
     'format' => 'm/d/Y - H:i',
     'locales' => array('en-us'),
   );
@@ -40,6 +35,11 @@ function system_default_date_formats() {
   );
   $formats[] = array(
     'type' => 'short',
+    'format' => 'Y-m-d H:i',
+    'locales' => array(),
+  );
+  $formats[] = array(
+    'type' => 'short',
     'format' => 'm/d/Y - g:ia',
     'locales' => array(),
   );
@@ -87,11 +87,6 @@ function system_default_date_formats() {
   // Medium date formats.
   $formats[] = array(
     'type' => 'medium',
-    'format' => 'D, Y-m-d H:i',
-    'locales' => array(),
-  );
-  $formats[] = array(
-    'type' => 'medium',
     'format' => 'D, m/d/Y - H:i',
     'locales' => array('en-us'),
   );
@@ -107,6 +102,11 @@ function system_default_date_formats() {
   );
   $formats[] = array(
     'type' => 'medium',
+    'format' => 'D, Y-m-d H:i',
+    'locales' => array(),
+  );
+  $formats[] = array(
+    'type' => 'medium',
     'format' => 'F j, Y - H:i',
     'locales' => array(),
   );
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.221
diff -u -p -r1.221 system.api.php
--- modules/system/system.api.php	9 Dec 2010 01:51:16 -0000	1.221
+++ modules/system/system.api.php	9 Dec 2010 23:53:23 -0000
@@ -3692,6 +3692,11 @@ function hook_archiver_info_alter(&$info
  * recommended that each date type starts with the module name. A date type
  * can consist of letters, numbers and underscores.
  *
+ * You can use hook_date_formats() to provide date formats for this date type.
+ * In case a date format has not been explicitly set for this date type by the
+ * administrator, the first format provided in hook_date_formats() for this date
+ * type is used.
+ *
  * @return
  *   An array of date types where the keys are the machine-readable names and
  *   the values are the human-readable labels.
