diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index de6a4ef..0bba986 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2161,13 +2161,16 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
  */
 function drupal_get_user_timezone() {
   global $user;
-  if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
+  $config = config('system.date');
+
+  if ($config->get('timezone.user.configurable') && $user->uid && $user->timezone) {
     return $user->timezone;
   }
   else {
     // Ignore PHP strict notice if time zone has not yet been set in the php.ini
     // configuration.
-    return variable_get('date_default_timezone', @date_default_timezone_get());
+    $config_data_default_timezone = $config->get('timezone.default');
+    return isset($config_data_default_timezone) ? $config_data_default_timezone : @date_default_timezone_get();
   }
 }
 
diff --git a/core/includes/common.inc b/core/includes/common.inc
index d0e9a2f..24b14dc 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1920,58 +1920,14 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
     $langcode = language(LANGUAGE_TYPE_INTERFACE)->langcode;
   }
 
-  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 'html_datetime':
-      $format = variable_get('date_format_html_datetime', 'Y-m-d\TH:i:sO');
-      break;
-
-    case 'html_date':
-      $format = variable_get('date_format_html_date', 'Y-m-d');
-      break;
-
-    case 'html_time':
-      $format = variable_get('date_format_html_time', 'H:i:s');
-      break;
-
-    case 'html_yearless_date':
-      $format = variable_get('date_format_html_yearless_date', 'm-d');
-      break;
-
-    case 'html_week':
-      $format = variable_get('date_format_html_week', 'Y-\WW');
-      break;
-
-    case 'html_month':
-      $format = variable_get('date_format_html_month', 'Y-m');
-      break;
-
-    case 'html_year':
-      $format = variable_get('date_format_html_year', 'Y');
-      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;
+  // Handle the base case: $type == 'custom'
+  // if $type is custom use the format that is provided by the $format argument
+  if ($type != 'custom') {
+    $format = config('system.date')->get('formats.' . $type . '.pattern');
+    if (!isset($format)) {
+      // If that type didn't exist return format medium's value
+      $format = config('system.date')->get('formats.system_medium.pattern');
+    }
   }
 
   // Create a DateTime object from the timestamp.
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 5f580fb..8abac99 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -2953,7 +2953,7 @@ function form_process_date($element) {
   $element['#tree'] = TRUE;
 
   // Determine the order of day, month, year in the site's chosen date format.
-  $format = variable_get('date_format_short', 'm/d/Y - H:i');
+  $format = config('system.date')->get('formats.sytem_short.pattern');
   $sort = array();
   $sort['day'] = max(strpos($format, 'd'), strpos($format, 'j'));
   $sort['month'] = max(strpos($format, 'm'), strpos($format, 'M'));
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 81b9b6a..8efd087 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1908,7 +1908,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
     '#type' => 'select',
     '#title' => st('Default country'),
     '#empty_value' => '',
-    '#default_value' => variable_get('site_default_country', NULL),
+    '#default_value' => config('system.date')->get('country.default'),
     '#options' => $countries,
     '#description' => st('Select the default country for the site.'),
     '#weight' => 0,
@@ -1974,8 +1974,10 @@ function install_configure_form_submit($form, &$form_state) {
     ->set('mail', $form_state['values']['site_mail'])
     ->save();
 
-  variable_set('date_default_timezone', $form_state['values']['date_default_timezone']);
-  variable_set('site_default_country', $form_state['values']['site_default_country']);
+  config('system.date')
+    ->set('timezone.default', $form_state['values']['date_default_timezone'])
+    ->set('country.default', $form_state['values']['site_default_country'])
+    ->save();
 
   // Enable update.module if this option was selected.
   if ($form_state['values']['update_status_module'][1]) {
diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc
index 78ca5bc..15ed9bd 100644
--- a/core/modules/aggregator/aggregator.pages.inc
+++ b/core/modules/aggregator/aggregator.pages.inc
@@ -335,7 +335,7 @@ function template_preprocess_aggregator_item(&$variables) {
     $variables['source_date'] = t('%ago ago', array('%ago' => format_interval(REQUEST_TIME - $item->timestamp)));
   }
   else {
-    $variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
+    $variables['source_date'] = format_date($item->timestamp, 'custom', config('system.date')->get('formats.system_medium.pattern'));
   }
 
   $variables['categories'] = array();
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index a32d47d..b069a9e 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -503,7 +503,7 @@ function locale_library_info_alter(&$libraries, $module) {
           'ui' => array(
             'datepicker' => array(
               'isRTL' => $language_interface->direction == LANGUAGE_RTL,
-              'firstDay' => variable_get('date_first_day', 0),
+              'firstDay' => config('system.date')->get('first_day'),
             ),
           ),
         ),
diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php
index d556309..0e29aab 100644
--- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php
+++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php
@@ -41,8 +41,11 @@ class OpenIDRegistrationTest extends OpenIDTestBase {
    */
   function testRegisterUserWithEmailVerification() {
     config('user.settings')->set('verify_mail', TRUE)->save();
-    variable_get('configurable_timezones', 1);
-    variable_set('date_default_timezone', 'Europe/Brussels');
+
+    config('system.date')
+      ->set('timezone.user.configurable', 1)
+      ->set('timezone.default', 'Europe/Brussels')
+      ->save();
 
     // Tell openid_test.module to respond with these SREG fields.
     variable_set('openid_test_response', array(
@@ -98,8 +101,11 @@ class OpenIDRegistrationTest extends OpenIDTestBase {
    */
   function testRegisterUserWithoutEmailVerification() {
     config('user.settings')->set('verify_mail', FALSE)->save();
-    variable_get('configurable_timezones', 1);
-    variable_set('date_default_timezone', 'Europe/Brussels');
+
+    config('system.date')
+      ->set('timezone.user.configurable', 1)
+      ->set('timezone.default', 'Europe/Brussels')
+      ->save();
 
     // Tell openid_test.module to respond with these SREG fields.
     variable_set('openid_test_response', array(
@@ -139,8 +145,10 @@ class OpenIDRegistrationTest extends OpenIDTestBase {
    * information (a username that is already taken, and no e-mail address).
    */
   function testRegisterUserWithInvalidSreg() {
-    variable_get('configurable_timezones', 1);
-    variable_set('date_default_timezone', 'Europe/Brussels');
+    config('system.date')
+      ->set('timezone.user.configurable', 1)
+      ->set('timezone.default', 'Europe/Brussels')
+      ->save();
 
     // Tell openid_test.module to respond with these SREG fields.
     $web_user = $this->drupalCreateUser(array());
@@ -190,7 +198,6 @@ class OpenIDRegistrationTest extends OpenIDTestBase {
    * information (i.e. no username or e-mail address).
    */
   function testRegisterUserWithoutSreg() {
-    variable_get('configurable_timezones', 1);
 
     // Load the front page to get the user login block.
     $this->drupalGet('');
@@ -230,7 +237,9 @@ class OpenIDRegistrationTest extends OpenIDTestBase {
    */
   function testRegisterUserWithAXButNoSREG() {
     config('user.settings')->set('verify_mail', FALSE)->save();
-    variable_set('date_default_timezone', 'Europe/Brussels');
+    config('system.date')
+      ->set('timezone.default', 'Europe/Brussels')
+      ->save();
 
     // Tell openid_test.module to respond with these AX fields.
     variable_set('openid_test_response', array(
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
index 9639758..b850ba4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
@@ -35,15 +35,19 @@ class FormatDateTest extends WebTestBase {
   }
 
   function setUp() {
-    parent::setUp();
-    variable_set('configurable_timezones', 1);
-    variable_set('date_format_long', 'l, j. F Y - G:i');
-    variable_set('date_format_medium', 'j. F Y - G:i');
-    variable_set('date_format_short', 'Y M j - g:ia');
+    parent::setUp('language');
+    config('system.date')
+      ->set('timezone.user.configurable', 1)
+      ->set('formats.system_long.pattern', 'l, j. F Y - G:i')
+      ->set('formats.system_medium.pattern', 'j. F Y - G:i')
+      ->set('formats.system_short.pattern', 'Y M j - g:ia')
+      ->save();
+
     variable_set('locale_custom_strings_' . self::LANGCODE, array(
       '' => array('Sunday' => 'domingo'),
       'Long month name' => array('March' => 'marzo'),
     ));
+
     $this->refreshVariables();
   }
 
@@ -57,16 +61,12 @@ class FormatDateTest extends WebTestBase {
 
     // Add new date format.
     $admin_date_format = 'j M y';
-    $edit = array('date_format' => $admin_date_format);
-    $this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
-
-    // Add new date type.
     $edit = array(
-      'date_type' => 'Example Style',
-      'machine_name' => 'example_style',
-      'date_format' => $admin_date_format,
+      'dfid' => 'example_style',
+      'date_format_name' => 'Example Style',
+      'date_format_pattern' => $admin_date_format,
     );
-    $this->drupalPost('admin/config/regional/date-time/types/add', $edit, t('Add date type'));
+    $this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
 
     $timestamp = strtotime('2007-03-10T00:00:00+00:00');
     $this->assertIdentical(format_date($timestamp, 'example_style', '', 'America/Los_Angeles'), '9 Mar 07', t('Test format_date() using an admin-defined date type.'));
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
index 6494a4a..a1db7c4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
@@ -44,9 +44,11 @@ class DateTimeTest extends WebTestBase {
    */
   function testTimeZoneHandling() {
     // Setup date/time settings for Honolulu time.
-    variable_set('date_default_timezone', 'Pacific/Honolulu');
-    variable_set('configurable_timezones', 0);
-    variable_set('date_format_medium', 'Y-m-d H:i:s O');
+    $config = config('system.date')
+      ->set('timezone.default', 'Pacific/Honolulu')
+      ->set('timezone.user.configurable', 0)
+      ->set('formats.system_medium.pattern', 'Y-m-d H:i:s O')
+      ->save();
 
     // Create some nodes with different authored-on dates.
     $date1 = '2007-01-31 21:00:00 -1000';
@@ -61,7 +63,7 @@ class DateTimeTest extends WebTestBase {
     $this->assertText('2007-07-31 21:00:00 -1000', t('Date should be identical, with GMT offset of -10 hours.'));
 
     // Set time zone to Los Angeles time.
-    variable_set('date_default_timezone', 'America/Los_Angeles');
+    $config->set('timezone.default', 'America/Los_Angeles')->save();
 
     // Confirm date format and time zone.
     $this->drupalGet("node/$node1->nid");
@@ -71,64 +73,35 @@ class DateTimeTest extends WebTestBase {
   }
 
   /**
-   * Test date type configuration.
+   * Test date format configuration.
    */
-  function testDateTypeConfiguration() {
+  function testDateFormatConfiguration() {
     // Confirm system date types appear.
     $this->drupalGet('admin/config/regional/date-time');
     $this->assertText(t('Medium'), 'System date types appear in date type list.');
     $this->assertNoRaw('href="/admin/config/regional/date-time/types/medium/delete"', 'No delete link appear for system date types.');
 
-    // Add custom date type.
-    $this->clickLink(t('Add date type'));
-    $date_type = strtolower($this->randomName(8));
-    $machine_name = 'machine_' . $date_type;
-    $date_format = 'd.m.Y - H:i';
-    $edit = array(
-      'date_type' => $date_type,
-      'machine_name' => $machine_name,
-      'date_format' => $date_format,
-    );
-    $this->drupalPost('admin/config/regional/date-time/types/add', $edit, t('Add date type'));
-    $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), t('Correct page redirection.'));
-    $this->assertText(t('New date type added successfully.'), 'Date type added confirmation message appears.');
-    $this->assertText($date_type, 'Custom date type appears in the date type list.');
-    $this->assertText(t('delete'), 'Delete link for custom date type appears.');
-
-    // Delete custom date type.
-    $this->clickLink(t('delete'));
-    $this->drupalPost('admin/config/regional/date-time/types/' . $machine_name . '/delete', array(), t('Remove'));
-    $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), t('Correct page redirection.'));
-    $this->assertText(t('Removed date type ' . $date_type), 'Custom date type removed.');
-  }
-
-  /**
-   * Test date format configuration.
-   */
-  function testDateFormatConfiguration() {
-    // Confirm 'no custom date formats available' message appears.
-    $this->drupalGet('admin/config/regional/date-time/formats');
-    $this->assertText(t('No custom date formats available.'), 'No custom date formats message appears.');
-
     // Add custom date format.
     $this->clickLink(t('Add format'));
+    $dfid = strtolower($this->randomName(8));
+    $name = ucwords($dfid);
+    $date_format = 'd.m.Y - H:i';
     $edit = array(
-      'date_format' => 'Y',
+      'dfid' => $dfid,
+      'date_format_name' => $name,
+      'date_format_pattern' => $date_format,
     );
     $this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), t('Correct page redirection.'));
-    $this->assertNoText(t('No custom date formats available.'), 'No custom date formats message does not appear.');
-    $this->assertText(t('Custom date format added.'), 'Custom date format added.');
-
-    // Ensure custom date format appears in date type configuration options.
-    $this->drupalGet('admin/config/regional/date-time');
-    $this->assertRaw('<option value="Y">', 'Custom date format appears in options.');
+    $this->assertText(t('Custom date format updated.'), 'Date format added confirmation message appears.');
+    $this->assertText($dfid, 'Custom date format appears in the date format list.');
+    $this->assertText(t('delete'), 'Delete link for custom date format appears.');
 
     // Edit custom date format.
     $this->drupalGet('admin/config/regional/date-time/formats');
     $this->clickLink(t('edit'));
     $edit = array(
-      'date_format' => 'Y m',
+      'date_format_pattern' => 'Y m',
     );
     $this->drupalPost($this->getUrl(), $edit, t('Save format'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), t('Correct page redirection.'));
@@ -136,32 +109,28 @@ class DateTimeTest extends WebTestBase {
 
     // Delete custom date format.
     $this->clickLink(t('delete'));
-    $this->drupalPost($this->getUrl(), array(), t('Remove'));
+    $this->drupalPost('admin/config/regional/date-time/formats/' . $dfid . '/delete', array(), t('Remove'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), t('Correct page redirection.'));
-    $this->assertText(t('Removed date format'), 'Custom date format removed successfully.');
+    $this->assertText(t('Removed date format ' . $name), 'Custom date format removed.');
   }
 
   /**
    * Test if the date formats are stored properly.
    */
   function testDateFormatStorage() {
-    $date_format = array(
-      'type' => 'short',
-      'format' => 'dmYHis',
-      'locked' => 0,
-      'is_new' => 1,
+    $date_format_info = array(
+      'name' => 'testDateFormatStorage Short Format',
+      'pattern' => 'dmYHis',
     );
-    system_date_format_save($date_format);
 
-    $format = db_select('date_formats', 'df')
-      ->fields('df', array('format'))
-      ->condition('type', 'short')
-      ->condition('format', 'dmYHis')
-      ->execute()
-      ->fetchField();
+    system_date_format_save('test_short', $date_format_info);
+
+    $format = config('system.date')->get('formats.test_short.pattern');
     $this->verbose($format);
-    $this->assertEqual('dmYHis', $format, 'Unlocalized date format resides in general table.');
+    $this->assertEqual('dmYHis', $format['pattern'], 'Unlocalized date format resides in general table.');
 
+    // When localized config is possible
+    /*
     $format = db_select('date_format_locale', 'dfl')
       ->fields('dfl', array('format'))
       ->condition('type', 'short')
@@ -211,5 +180,6 @@ class DateTimeTest extends WebTestBase {
       ->execute()
       ->fetchColumn();
     $this->assertFalse($format, 'Localized date format for disabled language is ignored.');
+    */
   }
 }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 921c887..d9647f3 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1852,11 +1852,12 @@ function system_rss_feeds_settings_submit($form, &$form_state) {
  * Form builder; Configure the site regional settings.
  *
  * @ingroup forms
- * @see system_settings_form()
+ * @see system_config_form()
  * @see system_regional_settings_submit()
  */
-function system_regional_settings() {
+function system_regional_settings($form, &$form_state) {
   $countries = country_get_list();
+  $config = config('system.date');
 
   // Date settings:
   $zones = system_time_zones();
@@ -1870,7 +1871,7 @@ function system_regional_settings() {
     '#type' => 'select',
     '#title' => t('Default country'),
     '#empty_value' => '',
-    '#default_value' => variable_get('site_default_country', ''),
+    '#default_value' => $config->get('country.default'),
     '#options' => $countries,
     '#attributes' => array('class' => array('country-detect')),
   );
@@ -1878,7 +1879,7 @@ function system_regional_settings() {
   $form['locale']['date_first_day'] = array(
     '#type' => 'select',
     '#title' => t('First day of week'),
-    '#default_value' => variable_get('date_first_day', 0),
+    '#default_value' => $config->get('first_day'),
     '#options' => array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')),
   );
 
@@ -1887,14 +1888,15 @@ function system_regional_settings() {
     '#title' => t('Time zones'),
   );
 
+  $date_default_timezone = $config->get('timezone.default');
   $form['timezone']['date_default_timezone'] = array(
     '#type' => 'select',
     '#title' => t('Default time zone'),
-    '#default_value' => variable_get('date_default_timezone', date_default_timezone_get()),
+    '#default_value' => isset($date_default_timezone) ? $date_default_timezone : date_default_timezone_get(),
     '#options' => $zones,
   );
 
-  $configurable_timezones = variable_get('configurable_timezones', 1);
+  $configurable_timezones = $config->get('timezone.user.configurable');
   $form['timezone']['configurable_timezones'] = array(
     '#type' => 'checkbox',
     '#title' => t('Users may set their own time zone.'),
@@ -1914,14 +1916,14 @@ function system_regional_settings() {
   $form['timezone']['configurable_timezones_wrapper']['empty_timezone_message'] = array(
     '#type' => 'checkbox',
     '#title' => t('Remind users at login if their time zone is not set.'),
-    '#default_value' => variable_get('empty_timezone_message', 0),
+    '#default_value' => $config->get('timezone.user.warn'),
     '#description' => t('Only applied if users may set their own time zone.')
   );
 
   $form['timezone']['configurable_timezones_wrapper']['user_default_timezone'] = array(
     '#type' => 'radios',
     '#title' => t('Time zone for new users'),
-    '#default_value' => variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT),
+    '#default_value' => $config->get('timezone.user.default'),
     '#options' => array(
       DRUPAL_USER_TIMEZONE_DEFAULT => t('Default time zone.'),
       DRUPAL_USER_TIMEZONE_EMPTY   => t('Empty time zone.'),
@@ -1930,7 +1932,24 @@ function system_regional_settings() {
     '#description' => t('Only applied if users may set their own time zone.')
   );
 
-  return system_settings_form($form);
+  return system_config_form($form, $form_state);
+}
+
+/**
+ * Form builder submit handler; Handle submission for regional settings.
+ *
+ * @ingroup forms
+ * @see system_regional_settings()
+ */
+function system_regional_settings_submit($form, &$form_state) {
+  config('system.date')
+    ->set('country.default', $form_state['values']['site_default_country'])
+    ->set('first_day', $form_state['values']['date_first_day'])
+    ->set('timezone.default', $form_state['values']['date_default_timezone'])
+    ->set('timezone.user.configurable', $form_state['values']['configurable_timezones'])
+    ->set('timezone.user.warn', $form_state['values']['empty_timezone_message'])
+    ->set('timezone.user.default', $form_state['values']['user_default_timezone'])
+    ->save();
 }
 
 /**
@@ -1940,72 +1959,33 @@ function system_regional_settings() {
  * @see system_settings_form()
  */
 function system_date_time_settings() {
-  // Get list of all available date types.
-  drupal_static_reset('system_get_date_types');
-  $format_types = system_get_date_types();
-
-  // Get list of all available date formats.
-  $all_formats = array();
-  drupal_static_reset('system_get_date_formats');
-  $date_formats = system_get_date_formats(); // Call this to rebuild the list, and to have default list.
-  foreach ($date_formats as $type => $format_info) {
-    $all_formats = array_merge($all_formats, $format_info);
-  }
-  $custom_formats = system_get_date_formats('custom');
-  if (!empty($format_types)) {
-    foreach ($format_types as $type => $type_info) {
-      // If a system type, only show the available formats for that type and
-      // custom ones.
-      if ($type_info['locked'] == 1) {
-        $formats = system_get_date_formats($type);
-        if (empty($formats)) {
-          $formats = $all_formats;
-        }
-        elseif (!empty($custom_formats)) {
-          $formats = array_merge($formats, $custom_formats);
-        }
-      }
-      // If a user configured type, show all available date formats.
-      else {
-        $formats = $all_formats;
-      }
+  // Display any user-defined date formats
+  $date_formats = system_get_date_formats();
 
-      $choices = array();
-      foreach ($formats as $f => $format) {
-        $choices[$f] = format_date(REQUEST_TIME, 'custom', $f);
-      }
-      reset($formats);
-      $default = variable_get('date_format_' . $type, key($formats));
-
-      // Get date type info for this date type.
-      $type_info = system_get_date_types($type);
-      $form['formats']['#theme'] = 'system_date_time_settings';
-
-      // Show date format select list.
-      $form['formats']['format']['date_format_' . $type] = array(
-        '#type' => 'select',
-        '#title' => check_plain($type_info['title']),
-        '#attributes' => array('class' => array('date-format')),
-        '#default_value' => (isset($choices[$default]) ? $default : 'custom'),
-        '#options' => $choices,
-      );
+  $header = array(
+    'machine_name' => array('data' => t('Machine name')),
+    'name' => array('data' => t('Name')),
+    'pattern' => array('data' => t('Date format')),
+    'example' => array('data' => t('Example of use')),
+  );
 
-      // If this isn't a system provided type, allow the user to remove it from
-      // the system.
-      if ($type_info['locked'] == 0) {
-        $form['formats']['delete']['date_format_' . $type . '_delete'] = array(
-          '#type' => 'link',
-          '#title' => t('delete'),
-          '#href' => 'admin/config/regional/date-time/types/' . $type . '/delete',
-        );
-      }
-    }
+  $rows = array();
+  foreach ($date_formats as $dfid => $format_info) {
+    $rows[] = array(
+      $dfid,
+      $format_info['name'],
+      $format_info['pattern'],
+      format_date(REQUEST_TIME, 'custom', $format_info['pattern']),
+    );
   }
 
-  // Display a message if no date types configured.
-  $form['#empty_text'] = t('No date types available. <a href="@link">Add date type</a>.', array('@link' => url('admin/config/regional/date-time/types/add')));
+  $variables = array(
+    'header' => $header,
+    'rows' => $rows,
+  );
 
-  return system_settings_form($form);
+
+  //return system_settings_form($form);
 }
 
 /**
@@ -2049,6 +2029,7 @@ function theme_system_date_time_settings($variables) {
  * @ingroup system_add_date_format_type_form_validate()
  * @ingroup system_add_date_format_type_form_submit()
  */
+/*
 function system_add_date_format_type_form($form, &$form_state) {
   $form['date_type'] = array(
     '#title' => t('Date type'),
@@ -2098,10 +2079,11 @@ function system_add_date_format_type_form($form, &$form_state) {
 
   return $form;
 }
-
+*/
 /**
  * Validate system_add_date_format_type form submissions.
  */
+/*
 function system_add_date_format_type_form_validate($form, &$form_state) {
   if (!empty($form_state['values']['machine_name']) && !empty($form_state['values']['date_type'])) {
     if (!preg_match("/^[a-zA-Z0-9_]+$/", trim($form_state['values']['machine_name']))) {
@@ -2113,10 +2095,11 @@ function system_add_date_format_type_form_validate($form, &$form_state) {
     }
   }
 }
-
+*/
 /**
  * Process system_add_date_format_type form submissions.
  */
+/*
 function system_add_date_format_type_form_submit($form, &$form_state) {
   $machine_name = trim($form_state['values']['machine_name']);
 
@@ -2126,12 +2109,12 @@ function system_add_date_format_type_form_submit($form, &$form_state) {
   $format_type['locked'] = 0;
   $format_type['is_new'] = 1;
   system_date_format_type_save($format_type);
-  variable_set('date_format_' . $machine_name, $form_state['values']['date_format']);
+  config('system.date')->set('formats.' . $machine_name . '.pattern', $form_state['values']['date_format'])->save();
 
   drupal_set_message(t('New date type added successfully.'));
   $form_state['redirect'] = 'admin/config/regional/date-time';
 }
-
+*/
 /**
  * Return the date for a given format string via Ajax.
  */
@@ -2656,16 +2639,18 @@ function theme_system_themes_page($variables) {
 
 /**
  * Menu callback; present a form for deleting a date format.
+ *
+ * @param string $dfid
+ *   The machine name for the date format that may be deleted
  */
 function system_date_delete_format_form($form, &$form_state, $dfid) {
   $form['dfid'] = array(
     '#type' => 'value',
     '#value' => $dfid,
   );
-  $format = system_get_date_format($dfid);
-
+  $format = system_get_date_formats($dfid);
   $output = confirm_form($form,
-    t('Are you sure you want to remove the format %format?', array('%format' => format_date(REQUEST_TIME, 'custom', $format->format))),
+    t('Are you sure you want to remove the format %name : %format?', array('%name' => $format['name'], '%format' => format_date(REQUEST_TIME, 'custom', $format['pattern']))),
     'admin/config/regional/date-time/formats',
     t('This action cannot be undone.'),
     t('Remove'), t('Cancel'),
@@ -2680,9 +2665,9 @@ function system_date_delete_format_form($form, &$form_state, $dfid) {
  */
 function system_date_delete_format_form_submit($form, &$form_state) {
   if ($form_state['values']['confirm']) {
-    $format = system_get_date_format($form_state['values']['dfid']);
+    $format = system_get_date_formats($form_state['values']['dfid']);
     system_date_format_delete($form_state['values']['dfid']);
-    drupal_set_message(t('Removed date format %format.', array('%format' => format_date(REQUEST_TIME, 'custom', $format->format))));
+    drupal_set_message(t('Removed date format %format.', array('%format' => format_date(REQUEST_TIME, 'custom', $format['name']))));
     $form_state['redirect'] = 'admin/config/regional/date-time/formats';
   }
 }
@@ -2690,6 +2675,7 @@ function system_date_delete_format_form_submit($form, &$form_state) {
 /**
  * Menu callback; present a form for deleting a date type.
  */
+/*
 function system_delete_date_format_type_form($form, &$form_state, $format_type) {
   $form['format_type'] = array(
     '#type' => 'value',
@@ -2707,10 +2693,11 @@ function system_delete_date_format_type_form($form, &$form_state, $format_type)
 
   return $output;
 }
-
+*/
 /**
  * Delete a configured date type.
  */
+/*
 function system_delete_date_format_type_form_submit($form, &$form_state) {
   if ($form_state['values']['confirm']) {
     $type_info = system_get_date_types($form_state['values']['format_type']);
@@ -2719,23 +2706,31 @@ function system_delete_date_format_type_form_submit($form, &$form_state) {
     $form_state['redirect'] = 'admin/config/regional/date-time';
   }
 }
-
+*/
 
 /**
  * Displays the date format strings overview page.
  */
 function system_date_time_formats() {
-  $header = array(t('Format'), array('data' => t('Operations'), 'colspan' => '2'));
+  $header = array(
+    'machine_name' => t('Machine Name'),
+    'name' => t('Name'),
+    'pattern' => t('Format'),
+    'operations' => array('data' => t('Operations'), 'colspan' => '2'),
+  );
   $rows = array();
 
-  drupal_static_reset('system_get_date_formats');
-  $formats = system_get_date_formats('custom');
+  $formats = system_get_date_formats();
+
   if (!empty($formats)) {
-    foreach ($formats as $format) {
+    foreach ($formats as $dfid => $format_info) {
+
       $row = array();
-      $row[] = array('data' => format_date(REQUEST_TIME, 'custom', $format['format']));
-      $row[] = array('data' => l(t('edit'), 'admin/config/regional/date-time/formats/' . $format['dfid'] . '/edit'));
-      $row[] = array('data' => l(t('delete'), 'admin/config/regional/date-time/formats/' . $format['dfid'] . '/delete'));
+      $row['machine_name'] = array('data' => $dfid);
+      $row['name'] = array('data' => $format_info['name']);
+      $row[] = array('data' => format_date(REQUEST_TIME, 'custom', $format_info['pattern']));
+      $row[] = array('data' => l(t('edit'), 'admin/config/regional/date-time/formats/' . $dfid . '/edit'));
+      $row[] = array('data' => l(t('delete'), 'admin/config/regional/date-time/formats/' . $dfid . '/delete'));
       $rows[] = $row;
     }
   }
@@ -2752,13 +2747,17 @@ function system_date_time_formats() {
 
 /**
  * Allow users to add additional date formats.
+ *
+ * @param string $dfid (optional)
+ *   When present, provides the machine name of the date format that is being
+ *   modified.
  */
-function system_configure_date_formats_form($form, &$form_state, $dfid = 0) {
+function system_configure_date_formats_form($form, &$form_state, $dfid = '') {
   $js_settings = array(
     'type' => 'setting',
     'data' => array(
       'dateTime' => array(
-        'date-format' => array(
+        'date-format-pattern' => array(
           'text' => t('Displayed as'),
           'lookup' => url('admin/config/regional/date-time/formats/lookup'),
         ),
@@ -2766,22 +2765,42 @@ function system_configure_date_formats_form($form, &$form_state, $dfid = 0) {
     ),
   );
 
-  if ($dfid) {
+  if (empty($dfid)) {
+    $form['dfid'] = array(
+      '#type' => 'machine_name',
+      '#title' => t('Machine-readable name'),
+      '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
+      '#machine_name' => array(
+        'exists' => 'system_date_format_exists',
+        'source' => array('machine_name'),
+      ),
+    );
+    $now = '';
+  }
+  else {
     $form['dfid'] = array(
       '#type' => 'value',
       '#value' => $dfid,
     );
-    $format = system_get_date_format($dfid);
+    $format = system_get_date_formats($dfid);
+    $now = t('Displayed as %date', array('%date' => format_date(REQUEST_TIME, 'custom', $format['pattern'])));
   }
 
-  $now = ($dfid ? t('Displayed as %date', array('%date' => format_date(REQUEST_TIME, 'custom', $format->format))) : '');
+  $form['date_format_name'] = array(
+    '#type' => 'textfield',
+    '#title' => 'Name',
+    '#maxlength' => 100,
+    '#description' => t('Name of the date format'),
+    '#default_value' => empty($format['name']) ? '' : $format['name']
+  );
 
-  $form['date_format'] = array(
+
+  $form['date_format_pattern'] = array(
     '#type' => 'textfield',
     '#title' => t('Format string'),
     '#maxlength' => 100,
     '#description' => t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://php.net/manual/function.date.php')),
-    '#default_value' => ($dfid ? $format->format : ''),
+    '#default_value' => empty($format['pattern']) ? '' : $format['pattern'],
     '#field_suffix' => ' <small id="edit-date-format-suffix">' . $now . '</small>',
     '#attached' => array(
       'library' => array(array('system', 'drupal.system')),
@@ -2793,7 +2812,7 @@ function system_configure_date_formats_form($form, &$form_state, $dfid = 0) {
   $form['actions'] = array('#type' => 'actions');
   $form['actions']['update'] = array(
     '#type' => 'submit',
-    '#value' => ($dfid ? t('Save format') : t('Add format')),
+    '#value' => (!empty($dfid) ? t('Save format') : t('Add format')),
   );
 
   $form['#validate'][] = 'system_add_date_formats_form_validate';
@@ -2803,12 +2822,26 @@ function system_configure_date_formats_form($form, &$form_state, $dfid = 0) {
 }
 
 /**
+ * Check if the chosen machine_name exists or not
+ */
+function system_date_format_exists($candidate_machine_name) {
+  if ($formats = system_get_date_formats()) {
+    return array_key_exists($candidate_machine_name, $formats);
+  }
+  return FALSE;
+}
+
+/**
  * Validate new date format string submission.
  */
 function system_add_date_formats_form_validate($form, &$form_state) {
-  $formats = system_get_date_formats('custom');
-  $format = trim($form_state['values']['date_format']);
-  if (!empty($formats) && in_array($format, array_keys($formats)) && (!isset($form_state['values']['dfid']) || $form_state['values']['dfid'] != $formats[$format]['dfid'])) {
+  $formats = system_get_date_formats();
+  $format = trim($form_state['values']['date_format_pattern']);
+
+
+  // The machine name field should already check to see if the requested machine name is available
+  // Regardless of machine_name or human readable name, check to see if the provided pattern exists
+  if (!empty($formats) && in_array($format, array_values($formats)) && (!isset($form_state['values']['dfid']) || $form_state['values']['dfid'] != $formats[$format]['dfid'])) {
     form_set_error('date_format', t('This format already exists. Enter a unique format string.'));
   }
 }
@@ -2818,16 +2851,14 @@ function system_add_date_formats_form_validate($form, &$form_state) {
  */
 function system_add_date_formats_form_submit($form, &$form_state) {
   $format = array();
-  $format['format'] = trim($form_state['values']['date_format']);
-  $format['type'] = 'custom';
-  $format['locked'] = 0;
+  $format['name'] = check_plain($form_state['values']['date_format_name']);
+  $format['pattern'] = trim($form_state['values']['date_format_pattern']);
+
+  system_date_format_save($form_state['values']['dfid'], $format);
   if (!empty($form_state['values']['dfid'])) {
-    system_date_format_save($format, $form_state['values']['dfid']);
     drupal_set_message(t('Custom date format updated.'));
   }
   else {
-    $format['is_new'] = 1;
-    system_date_format_save($format);
     drupal_set_message(t('Custom date format added.'));
   }
 
@@ -3146,20 +3177,20 @@ function system_date_format_localize_form($form, &$form_state, $langcode) {
     '#value' => $langcode,
   );
 
-  // Get list of date format types.
-  $types = system_get_date_types();
+
 
   // Get list of available formats.
   $formats = system_get_date_formats();
   $choices = array();
-  foreach ($formats as $type => $list) {
-    foreach ($list as $f => $format) {
-      $choices[$f] = format_date(REQUEST_TIME, 'custom', $f);
+  foreach ($formats as $dfif => $format_info) {
+    foreach ($format_info as $name => $pattern) {
+      $choices[$pattern] = format_date(REQUEST_TIME, 'custom', $pattern);
     }
   }
   reset($formats);
 
   // Get configured formats for each language.
+  // todo: change this when we can localize CMI config
   $locale_formats = system_date_format_locale($langcode);
   // Display a form field for each format type.
   foreach ($types as $type => $type_info) {
@@ -3167,7 +3198,7 @@ function system_date_format_localize_form($form, &$form_state, $langcode) {
       $default = $locale_formats[$type];
     }
     else {
-      $default = variable_get('date_format_' . $type, key($formats));
+      $default = config('system.date')->get('formats.' . $type . '.pattern');
     }
 
     // Show date format select list.
@@ -3191,10 +3222,14 @@ function system_date_format_localize_form($form, &$form_state, $langcode) {
 
 /**
  * Submit handler for configuring localized date formats on the locale_date_format_form.
+ *
+ * todo: modify this function as result of having multi-linqual CMI config
  */
 function system_date_format_localize_form_submit($form, &$form_state) {
   $langcode = $form_state['values']['langcode'];
 
+
+
   // Get list of date format types.
   $types = system_get_date_types();
   foreach ($types as $type => $type_info) {
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 135dc23..b7f242a 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -3313,7 +3313,7 @@ function hook_archiver_info_alter(&$info) {
  *
  * To define a date type in a module and make sure a format has been assigned to
  * it, without requiring a user to visit the administrative interface, use
- * @code variable_set('date_format_' . $type, $format); @endcode
+ * @code config('system.date')->set('formats.' . $type . '.pattern', $format); @endcode
  * where $type is the machine-readable name defined here, and $format is a PHP
  * date format string.
  *
@@ -3383,7 +3383,7 @@ function hook_date_format_types_alter(&$types) {
  * initialization chooses a locale-specific format for the three core-provided
  * types (see system_get_localized_date_format() for details). If your module
  * needs to ensure that a date type it defines has a format associated with it,
- * call @code variable_set('date_format_' . $type, $format); @endcode
+ * call @code config('system.date')->set('format.' . $type, $format); @endcode
  * where $type is the machine-readable name defined in hook_date_format_types(),
  * and $format is a PHP date format string.
  *
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 0cdaf42..9d4140e 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -522,6 +522,21 @@ function system_install() {
   config('system.cron')
     ->set('key', $cron_key)
     ->save();
+  // Set date formats.
+  config('system.date')
+    ->set('formats', array(
+      'short' => 'm/d/Y - H:i',
+      'long' => 'l, F j, Y - H:i',
+      'html_datetime' => 'Y-m-d\TH:i:sO',
+      'html_date' => 'Y-m-d',
+      'html_time' => 'H:i:s',
+      'html_yearless_date' => 'm-d',
+      'html_week' => 'Y-\WW',
+      'html_month' => 'Y-m',
+      'html_year' => 'Y',
+      'medium' => 'D, m/d/Y - H:i',
+    ))
+    ->save();
 }
 
 /**
@@ -1989,6 +2004,22 @@ function system_update_8020() {
 }
 
 /**
+ * Moves site system regional settings from variable to config.
+ *
+ * @ingroup config_upgrade
+ */
+function system_update_8021() {
+  update_variables_to_config('system.date', array(
+    'site_default_country' => 'country.default',
+    'date_first_day' => 'first_day',
+    'date_default_timezone' => 'timezone.default',
+    'configurable_timezones' => 'timezone.user.configurable',
+    'empty_timezone_message' => 'timezone.user.warn',
+    'user_default_timezone' => 'timezone.user.default',
+  ));
+}
+
+/**
  * @} End of "defgroup updates-7.x-to-8.x".
  * The next series of updates should start at 9000.
  */
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index be79ff4..659e3d4 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -860,48 +860,10 @@ function system_menu() {
     'file' => 'system.admin.inc',
   );
   $items['admin/config/regional/date-time'] = array(
-    'title' => 'Date and time',
-    'description' => 'Configure display formats for date and time.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('system_date_time_settings'),
-    'access arguments' => array('administer site configuration'),
-    'weight' => -15,
-    'file' => 'system.admin.inc',
-  );
-  $items['admin/config/regional/date-time/types'] = array(
-    'title' => 'Types',
-    'description' => 'Configure display formats for date and time.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('system_date_time_settings'),
-    'access arguments' => array('administer site configuration'),
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-    'weight' => -10,
-    'file' => 'system.admin.inc',
-  );
-  $items['admin/config/regional/date-time/types/add'] = array(
-    'title' => 'Add date type',
-    'description' => 'Add new date type.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('system_add_date_format_type_form'),
-    'access arguments' => array('administer site configuration'),
-    'type' => MENU_LOCAL_ACTION,
-    'weight' => -10,
-    'file' => 'system.admin.inc',
-  );
-  $items['admin/config/regional/date-time/types/%/delete'] = array(
-    'title' => 'Delete date type',
-    'description' => 'Allow users to delete a configured date type.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('system_delete_date_format_type_form', 5),
-    'access arguments' => array('administer site configuration'),
-    'file' => 'system.admin.inc',
-  );
-  $items['admin/config/regional/date-time/formats'] = array(
     'title' => 'Formats',
     'description' => 'Configure display format strings for date and time.',
     'page callback' => 'system_date_time_formats',
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_LOCAL_TASK,
     'weight' => -9,
     'file' => 'system.admin.inc',
   );
@@ -1124,7 +1086,6 @@ function system_menu() {
  *
  * @see system_cron_access().
  */
-
 function system_cron_page() {
   drupal_page_is_cacheable(FALSE);
   drupal_cron_run();
@@ -2225,18 +2186,16 @@ function system_init() {
  *
  * @return
  *   An array of date formats.
+ *
+ * @todo: http://drupal.org/node/1733316 may greatly reduce the complexity here
+ *   it can provide a
+ *
  */
 function system_get_localized_date_format($languages) {
-  $formats = array();
-
+  $default_formats = system_get_date_formats();
   // Get list of different format types.
-  $format_types = system_get_date_types();
-  $short_default = variable_get('date_format_short', 'm/d/Y - H:i');
-
-  // Loop through each language until we find one with some date formats
-  // configured.
   foreach ($languages as $language) {
-    $date_formats = system_date_format_locale($language);
+    $date_formats = config('locale.config.' . $language->langcode . '.system.date')->get('formats');
     if (!empty($date_formats)) {
       // We have locale-specific date formats, so check for their types. If
       // we're missing a type, use the default setting instead.
@@ -2256,23 +2215,7 @@ function system_get_localized_date_format($languages) {
       return $formats;
     }
   }
-
-  // No locale specific formats found, so use defaults.
-  $system_types = array('short', 'medium', 'long');
-  // Handle system types separately as they have defaults if no variable exists.
-  $formats['date_format_short'] = $short_default;
-  $formats['date_format_medium'] = variable_get('date_format_medium', 'D, m/d/Y - H:i');
-  $formats['date_format_long'] = variable_get('date_format_long', 'l, F j, Y - H:i');
-
-  // For non-system types, get the default setting, otherwise use the short
-  // format.
-  foreach ($format_types as $type => $type_info) {
-    if (!in_array($type, $system_types)) {
-      $formats['date_format_' . $type] = variable_get('date_format_' . $type, $short_default);
-    }
-  }
-
-  return $formats;
+  return $default_formats;
 }
 
 /**
@@ -2310,7 +2253,7 @@ function system_custom_theme() {
  * Implements hook_form_FORM_ID_alter().
  */
 function system_form_user_profile_form_alter(&$form, &$form_state) {
-  if (variable_get('configurable_timezones', 1)) {
+  if (config('system.date')->get('timezone.user.configurable')) {
     system_user_timezone($form, $form_state);
   }
   return $form;
@@ -2320,7 +2263,8 @@ function system_form_user_profile_form_alter(&$form, &$form_state) {
  * Implements hook_form_FORM_ID_alter().
  */
 function system_form_user_register_form_alter(&$form, &$form_state) {
-  if (variable_get('configurable_timezones', 1) && variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT) == DRUPAL_USER_TIMEZONE_SELECT) {
+  $config = config('system.date');
+  if ($config->get('timezone.user.configurable') && $config->get('timezone.user.default') == DRUPAL_USER_TIMEZONE_SELECT) {
     system_user_timezone($form, $form_state);
     return $form;
   }
@@ -2330,8 +2274,9 @@ function system_form_user_register_form_alter(&$form, &$form_state) {
  * Implements hook_user_presave().
  */
 function system_user_presave($account) {
-  if (variable_get('configurable_timezones', 1) && empty($account->timezone) && !variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT)) {
-    $account->timezone = variable_get('date_default_timezone', '');
+  $config = config('system.date');
+  if ($config->get('timezone.user.configurable') && empty($account->timezone) && !$config->get('timezone.user.default')) {
+    $account->timezone = $config->get('timezone.default');
   }
 }
 
@@ -2339,8 +2284,9 @@ function system_user_presave($account) {
  * Implements hook_user_login().
  */
 function system_user_login(&$edit, $account) {
+  $config = config('system.date');
   // If the user has a NULL time zone, notify them to set a time zone.
-  if (!$account->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) {
+  if (!$account->timezone && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
     drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/$account->uid/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
   }
 }
@@ -2361,7 +2307,7 @@ function system_user_timezone(&$form, &$form_state) {
   $form['timezone']['timezone'] = array(
     '#type' => 'select',
     '#title' => t('Time zone'),
-    '#default_value' => isset($account->timezone) ? $account->timezone : ($account->uid == $user->uid ? variable_get('date_default_timezone', '') : ''),
+    '#default_value' => isset($account->timezone) ? $account->timezone : ($account->uid == $user->uid ? config('system.date')->get('timezone.default') : ''),
     '#options' => system_time_zones($account->uid != $user->uid),
     '#description' => t('Select the desired local time and time zone. Dates and times throughout this site will be displayed using this time zone.'),
   );
@@ -3479,7 +3425,7 @@ function system_cache_flush() {
  */
 function system_rebuild() {
   // Rebuild list of date formats.
-  system_date_formats_rebuild();
+  // system_date_formats_rebuild();
   // Synchronize any actions that were added or removed.
   actions_synchronize();
 }
@@ -3735,7 +3681,7 @@ function system_time_zones($blank = NULL) {
     // reasons and should not be used, the list is filtered by a regular
     // expression.
     if (preg_match('!^((Africa|America|Antarctica|Arctic|Asia|Atlantic|Australia|Europe|Indian|Pacific)/|UTC$)!', $zone)) {
-      $zones[$zone] = t('@zone: @date', array('@zone' => t(str_replace('_', ' ', $zone)), '@date' => format_date(REQUEST_TIME, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone)));
+      $zones[$zone] = t('@zone: @date', array('@zone' => t(str_replace('_', ' ', $zone)), '@date' => format_date(REQUEST_TIME, 'custom', config('system.date')->get('formats.system_long.pattern') . ' O', $zone)));
     }
   }
   // Sort the translated time zones alphabetically.
@@ -3880,48 +3826,6 @@ function system_run_automated_cron() {
 }
 
 /**
- * Gets the list of available date types and attributes.
- *
- * @param $type
- *   (optional) The date type name.
- *
- * @return
- *   An associative array of date type information keyed by the date type name.
- *   Each date type information array has the following elements:
- *   - type: The machine-readable name of the date type.
- *   - title: The human-readable name of the date type.
- *   - locked: A boolean indicating whether or not this date type should be
- *     configurable from the user interface.
- *   - module: The name of the module that defined this date type in its
- *     hook_date_format_types(). An empty string if the date type was
- *     user-defined.
- *   - is_new: A boolean indicating whether or not this date type is as of yet
- *     unsaved in the database.
- *   If $type was defined, only a single associative array with the above
- *   elements is returned.
- */
-function system_get_date_types($type = NULL) {
-  $types = &drupal_static(__FUNCTION__);
-
-  if (!isset($types)) {
-    $types = _system_date_format_types_build();
-  }
-
-  return $type ? (isset($types[$type]) ? $types[$type] : FALSE) : $types;
-}
-
-/**
- * Implements hook_date_format_types().
- */
-function system_date_format_types() {
-  return array(
-    'long' => t('Long'),
-    'medium' => t('Medium'),
-    'short' => t('Short'),
-  );
-}
-
-/**
  * Implements hook_date_formats().
  */
 function system_date_formats() {
@@ -3936,69 +3840,28 @@ function system_date_formats() {
  *   (optional) The date type name.
  *
  * @return
- *   An associative array of date formats. The top-level keys are the names of
- *   the date types that the date formats belong to. The values are in turn
- *   associative arrays keyed by the format string, with the following keys:
- *   - dfid: The date format ID.
- *   - format: The format string.
- *   - type: The machine-readable name of the date type.
- *   - locales: An array of language codes. This can include both 2 character
- *     language codes like 'en and 'fr' and 5 character language codes like
- *     'en-gb' and 'en-us'.
- *   - locked: A boolean indicating whether or not this date type should be
- *     configurable from the user interface.
- *   - module: The name of the module that defined this date format in its
- *     hook_date_formats(). An empty string if the format was user-defined.
- *   - is_new: A boolean indicating whether or not this date type is as of yet
- *     unsaved in the database.
- *   If $type was defined, only the date formats associated with the given date
- *   type are returned, in a single associative array keyed by format string.
- */
-function system_get_date_formats($type = NULL) {
-  $date_formats = &drupal_static(__FUNCTION__);
-
-  if (!isset($date_formats)) {
-    $date_formats = _system_date_formats_build();
-  }
+ *   An associative array of date formats. The top-level keys are the
+ *   machine-readable names of the date formats. The values are associative
+ *   arrays with the following keys:
+ *   - name: The human readable name of the date format.
+ *   - pattern: The pattern that will modify the format of the date
 
-  return $type ? (isset($date_formats[$type]) ? $date_formats[$type] : FALSE) : $date_formats;
-}
-
-/**
- * Gets the format details for a particular format ID.
- *
- * @param $dfid
- *   A date format ID.
- *
- * @return
- *   A date format object with the following properties:
- *   - dfid: The date format ID.
- *   - format: The date format string.
- *   - type: The name of the date type.
- *   - locked: Whether the date format can be changed or not.
+ *   If $dfid was defined, only the date formats associated with the given
+ *   machine name are returned, in a single associative array keyed by format
+ *   string.
  */
-function system_get_date_format($dfid) {
-  return db_query('SELECT df.dfid, df.format, df.type, df.locked FROM {date_formats} df WHERE df.dfid = :dfid', array(':dfid' => $dfid))->fetch();
-}
+function system_get_date_formats($dfid = NULL) {
+  $date_formats = config('system.date')->get('formats');
 
-/**
- * Resets the database cache of date formats and saves all new date formats.
- */
-function system_date_formats_rebuild() {
-  drupal_static_reset('system_get_date_formats');
-  $date_formats = system_get_date_formats(NULL);
-
-  foreach ($date_formats as $type => $formats) {
-    foreach ($formats as $format => $info) {
-      system_date_format_save($info);
-    }
+  // If a specific date format hasn't been requested output the entire list.
+  if (!$dfid) {
+    return $date_formats;
   }
 
-  // Rebuild configured date formats locale list.
-  drupal_static_reset('system_date_format_locale');
-  system_date_format_locale();
+  // todo: throw exception if the date_format that has been requested doesn't exist
 
-  _system_date_formats_build();
+  // Otherwise, return the specific date format
+  return $date_formats[$dfid];
 }
 
 /**
@@ -4008,293 +3871,69 @@ function system_date_formats_rebuild() {
  *   (optional) Language code for the current locale. This can be a 2 character
  *   language code like 'en' and 'fr' or a 5 character language code like
  *   'en-gb' and 'en-us'.
- * @param $type
- *   (optional) The date type name.
+ * @param $dfid
+ *   (optional) The machine name for the date format.
  *
  * @return
- *   If $type and $langcode are specified, returns the corresponding date format
+ *   If $dfid and $langcode are specified, returns the corresponding date format
  *   string. If only $langcode is specified, returns an array of all date
  *   format strings for that locale, keyed by the date type. If neither is
- *   specified, or if no matching formats are found, returns FALSE.
- */
-function system_date_format_locale($langcode = NULL, $type = NULL) {
-  $formats = &drupal_static(__FUNCTION__);
-
-  if (empty($formats)) {
-    $formats = array();
-    $result = db_query("SELECT format, type, language FROM {date_format_locale}");
-    foreach ($result as $record) {
-      if (!isset($formats[$record->language])) {
-        $formats[$record->language] = array();
-      }
-      $formats[$record->language][$record->type] = $record->format;
-    }
-  }
-
-  if ($type && $langcode && !empty($formats[$langcode][$type])) {
-    return $formats[$langcode][$type];
-  }
-  elseif ($langcode && !empty($formats[$langcode])) {
-    return $formats[$langcode];
-  }
-
-  return FALSE;
-}
-
-/**
- * Builds and returns information about available date types.
+ *   specified.
  *
- * @return
- *   An associative array of date type information keyed by name. Each date type
- *   information array has the following elements:
- *   - type: The machine-readable name of the date type.
- *   - title: The human-readable name of the date type.
- *   - locked: A boolean indicating whether or not this date type should be
- *     configurable from the user interface.
- *   - module: The name of the module that defined this format in its
- *     hook_date_format_types(). An empty string if the format was user-defined.
- *   - is_new: A boolean indicating whether or not this date type is as of yet
- *     unsaved in the database.
- */
-function _system_date_format_types_build() {
-  $types = array();
-
-  // Get list of modules that implement hook_date_format_types().
-  $modules = module_implements('date_format_types');
-
-  foreach ($modules as $module) {
-    $module_types = module_invoke($module, 'date_format_types');
-    foreach ($module_types as $module_type => $type_title) {
-      $type = array();
-      $type['module'] = $module;
-      $type['type'] = $module_type;
-      $type['title'] = $type_title;
-      $type['locked'] = 1;
-      // Will be over-ridden later if in the db.
-      $type['is_new'] = TRUE;
-      $types[$module_type] = $type;
-    }
-  }
-
-  // Get custom formats added to the database by the end user.
-  $result = db_query('SELECT dft.type, dft.title, dft.locked FROM {date_format_type} dft ORDER BY dft.title');
-  foreach ($result as $record) {
-    if (!isset($types[$record->type])) {
-      $type = array();
-      $type['is_new'] = FALSE;
-      $type['module'] = '';
-      $type['type'] = $record->type;
-      $type['title'] = $record->title;
-      $type['locked'] = $record->locked;
-      $types[$record->type] = $type;
-    }
-    else {
-      $type = array();
-      $type['is_new'] = FALSE;  // Over-riding previous setting.
-      $types[$record->type] = array_merge($types[$record->type], $type);
-    }
-  }
-
-  // Allow other modules to modify these date types.
-  drupal_alter('date_format_types', $types);
-
-  return $types;
-}
-
-/**
- * Builds and returns information about available date formats.
+ * @todo: previously it was possible for this function to return FALSE.
+ *        find all places where a FALSE value is expected and refactor
  *
- * @return
- *   An associative array of date formats. The top-level keys are the names of
- *   the date types that the date formats belong to. The values are in turn
- *   associative arrays keyed by format with the following keys:
- *   - dfid: The date format ID.
- *   - format: The PHP date format string.
- *   - type: The machine-readable name of the date type the format belongs to.
- *   - locales: An array of language codes. This can include both 2 character
- *     language codes like 'en and 'fr' and 5 character language codes like
- *     'en-gb' and 'en-us'.
- *   - locked: A boolean indicating whether or not this date type should be
- *     configurable from the user interface.
- *   - module: The name of the module that defined this format in its
- *     hook_date_formats(). An empty string if the format was user-defined.
- *   - is_new: A boolean indicating whether or not this date type is as of yet
- *     unsaved in the database.
+ * @todo: consider whether to remove this function
  */
-function _system_date_formats_build() {
-  $date_formats = array();
-
-  // First handle hook_date_format_types().
-  $types = _system_date_format_types_build();
-  foreach ($types as $type => $info) {
-    system_date_format_type_save($info);
-  }
-
-  // Get formats supplied by various contrib modules.
-  $module_formats = module_invoke_all('date_formats');
-
-  foreach ($module_formats as $module_format) {
-    // System types are locked.
-    $module_format['locked'] = 1;
-    // If no date type is specified, assign 'custom'.
-    if (!isset($module_format['type'])) {
-      $module_format['type'] = 'custom';
-    }
-    if (!in_array($module_format['type'], array_keys($types))) {
-      continue;
-    }
-    if (!isset($date_formats[$module_format['type']])) {
-      $date_formats[$module_format['type']] = array();
-    }
+function system_date_format_locale($langcode = NULL, $dfid = NULL) {
+  $formats = system_get_date_formats();
 
-    // If another module already set this format, merge in the new settings.
-    if (isset($date_formats[$module_format['type']][$module_format['format']])) {
-      $date_formats[$module_format['type']][$module_format['format']] = array_merge_recursive($date_formats[$module_format['type']][$module_format['format']], $module_format);
-    }
-    else {
-      // This setting will be overridden later if it already exists in the db.
-      $module_format['is_new'] = TRUE;
-      $date_formats[$module_format['type']][$module_format['format']] = $module_format;
-    }
+  // @todo: at this point have language specific date formats
+  if ($dfid && $langcode && !empty($formats[$langcode][$dfid])) {
+    return $formats[$langcode][$dfid];
   }
 
-  // Get custom formats added to the database by the end user.
-  $result = db_query('SELECT df.dfid, df.format, df.type, df.locked, dfl.language FROM {date_formats} df LEFT JOIN {date_format_type} dft ON df.type = dft.type LEFT JOIN {date_format_locale} dfl ON df.format = dfl.format AND df.type = dfl.type ORDER BY df.type, df.format');
-  foreach ($result as $record) {
-    // If this date type isn't set, initialise the array.
-    if (!isset($date_formats[$record->type])) {
-      $date_formats[$record->type] = array();
-    }
-    $format = (array) $record;
-    $format['is_new'] = FALSE; // It's in the db, so override this setting.
-    // If this format not already present, add it to the array.
-    if (!isset($date_formats[$record->type][$record->format])) {
-      $format['module'] = '';
-      $format['locales'] = array($record->language);
-      $date_formats[$record->type][$record->format] = $format;
-    }
-    // Format already present, so merge in settings.
-    else {
-      if (!empty($record->language)) {
-        $format['locales'] = array_merge($date_formats[$record->type][$record->format]['locales'], array($record->language));
-      }
-      $date_formats[$record->type][$record->format] = array_merge($date_formats[$record->type][$record->format], $format);
-    }
-  }
-
-  // Allow other modules to modify these formats.
-  drupal_alter('date_formats', $date_formats);
-
-  return $date_formats;
-}
-
-/**
- * Saves a date type to the database.
- *
- * @param $type
- *   A date type array containing the following keys:
- *   - type: The machine-readable name of the date type.
- *   - title: The human-readable name of the date type.
- *   - locked: A boolean indicating whether or not this date type should be
- *     configurable from the user interface.
- *   - is_new: A boolean indicating whether or not this date type is as of yet
- *     unsaved in the database.
- */
-function system_date_format_type_save($type) {
-  $info = array();
-  $info['type'] = $type['type'];
-  $info['title'] = $type['title'];
-  $info['locked'] = $type['locked'];
-
-  // Update date_format table.
-  if (!empty($type['is_new'])) {
-    drupal_write_record('date_format_type', $info);
-  }
-  else {
-    drupal_write_record('date_format_type', $info, 'type');
-  }
-}
-
-/**
- * Deletes a date type from the database.
- *
- * @param $type
- *   The machine-readable name of the date type.
- */
-function system_date_format_type_delete($type) {
-  db_delete('date_formats')
-    ->condition('type', $type)
-    ->execute();
-  db_delete('date_format_type')
-    ->condition('type', $type)
-    ->execute();
-  db_delete('date_format_locale')
-    ->condition('type', $type)
-    ->execute();
+  return FALSE;
 }
 
 /**
- * Saves a date format to the database.
+ * Saves a date format to the system.date configuration file.
  *
- * @param $date_format
- *   A date format array containing the following keys:
- *   - type: The name of the date type this format is associated with.
- *   - format: The PHP date format string.
- *   - locked: A boolean indicating whether or not this format should be
- *     configurable from the user interface.
- * @param $dfid
- *   If set, replace the existing date format having this ID with the
- *   information specified in $date_format.
+ * @param string $dfid
+ *   A machine readable name for the date format
+ * @param string $options
+ *   an array that contain the following properties of the date format:
+ *     - name: the human readable name of the date format
+ *     - pattern: the pattern that describes how to format the date
  *
- * @see system_get_date_types()
  * @see http://php.net/date
  */
-function system_date_format_save($date_format, $dfid = 0) {
-  $info = array();
-  $info['dfid'] = $dfid;
-  $info['type'] = $date_format['type'];
-  $info['format'] = $date_format['format'];
-  $info['locked'] = $date_format['locked'];
-
-  // Update date_format table.
-  if (!empty($date_format['is_new'])) {
-    drupal_write_record('date_formats', $info);
+function system_date_format_save($dfid, $options) {
+
+  if (empty($dfid)) {
+    // @todo: Throw an error
   }
-  else {
-    $keys = ($dfid ? array('dfid') : array('format', 'type'));
-    drupal_write_record('date_formats', $info, $keys);
+  if (empty($options)) {
+    // @todo: Throw an error
   }
 
-  $languages = language_list();
+  // Is the date format apart of the primary locale or not?
+  // $langcode = function_that_tells_us_the_context's langcode
+  $langcode = '';
 
-  $locale_format = array();
-  $locale_format['type'] = $date_format['type'];
-  $locale_format['format'] = $date_format['format'];
 
-  // Check if the suggested language codes are configured.
-  if (!empty($date_format['locales'])) {
-    foreach ($date_format['locales'] as $langcode) {
-      if (isset($languages[$langcode])) {
-        $is_existing = (bool) db_query_range('SELECT 1 FROM {date_format_locale} WHERE type = :type AND language = :language', 0, 1, array(':type' => $date_format['type'], ':language' => $langcode))->fetchField();
-        if (!$is_existing) {
-          $locale_format['language'] = $langcode;
-          drupal_write_record('date_format_locale', $locale_format);
-        }
-      }
-    }
-  }
+  // save the date format into the configuration file
+  config('system.date')->set('formats.' . $dfid, $options)->save();
 }
 
 /**
- * Deletes a date format from the database.
+ * Deletes a date format.
  *
- * @param $dfid
- *   The date format ID.
+ * @param string $dfid
+ *   The date format machine_name.
  */
 function system_date_format_delete($dfid) {
-  db_delete('date_formats')
-    ->condition('dfid', $dfid)
-    ->execute();
+  config('system.date')->delete($dfid);
 }
 
 /**
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
index d89192f..06f9a8e 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
@@ -149,17 +149,18 @@ class UserRegistrationTest extends WebTestBase {
   }
 
   function testRegistrationDefaultValues() {
-    $config = config('user.settings');
     // Don't require e-mail verification and allow registration by site visitors
     // without administrator approval.
-    $config
+    $config_user_settings = config('user.settings')
       ->set('verify_mail', FALSE)
       ->set('register', USER_REGISTER_VISITORS)
       ->save();
 
     // Set the default timezone to Brussels.
-    variable_set('configurable_timezones', 1);
-    variable_set('date_default_timezone', 'Europe/Brussels');
+    $config_system_date = config('system.date')
+      ->set('timezone.user.configurable', 1)
+      ->set('timezone.default', 'Europe/Brussels')
+      ->save();
 
     // Check that the account information fieldset's options are not displayed
     // is a fieldset if there is not more than one fieldset in the form.
@@ -181,8 +182,8 @@ class UserRegistrationTest extends WebTestBase {
     $this->assertEqual($new_user->theme, '', t('Correct theme field.'));
     $this->assertEqual($new_user->signature, '', t('Correct signature field.'));
     $this->assertTrue(($new_user->created > REQUEST_TIME - 20 ), t('Correct creation time.'));
-    $this->assertEqual($new_user->status, $config->get('register') == USER_REGISTER_VISITORS ? 1 : 0, t('Correct status field.'));
-    $this->assertEqual($new_user->timezone, variable_get('date_default_timezone'), t('Correct time zone field.'));
+    $this->assertEqual($new_user->status, $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, t('Correct status field.'));
+    $this->assertEqual($new_user->timezone, $config_system_date->get('timezone.default'), t('Correct time zone field.'));
     $this->assertEqual($new_user->langcode, language_default()->langcode, t('Correct language field.'));
     $this->assertEqual($new_user->preferred_langcode, language_default()->langcode, t('Correct preferred language field.'));
     $this->assertEqual($new_user->picture, 0, t('Correct picture field.'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
index 3ff4daf..413f234 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
@@ -26,9 +26,11 @@ class UserTimeZoneTest extends WebTestBase {
    */
   function testUserTimeZone() {
     // Setup date/time settings for Los Angeles time.
-    variable_set('date_default_timezone', 'America/Los_Angeles');
-    variable_set('configurable_timezones', 1);
-    variable_set('date_format_medium', 'Y-m-d H:i T');
+    $config = config('system.date')
+      ->set('timezone.user.configurable', 1)
+      ->set('timezone.default', 'America/Los_Angeles')
+      ->set('formats.system_medium.pattern', 'Y-m-d H:i T')
+      ->save();
 
     // Create a user account and login.
     $web_user = $this->drupalCreateUser();
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index 660c06b..1b73878 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -297,8 +297,9 @@ function hook_user_update($account) {
  *   The user object on which the operation was just performed.
  */
 function hook_user_login(&$edit, $account) {
+  $config = config('system.date');
   // If the user has a NULL time zone, notify them to set a time zone.
-  if (!$account->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) {
+  if (!$account->timezone && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
     drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/$account->uid/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
   }
 }
