diff --git a/core/includes/common.inc b/core/includes/common.inc
index 0f252ca..f89d11a 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -5,6 +5,7 @@
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Template\Attribute;
 
@@ -1896,21 +1897,42 @@ function format_interval($interval, $granularity = 2, $langcode = NULL) {
  * @param $langcode
  *   (optional) Language code to translate to. Defaults to the language used to
  *   display the page.
+ * @params array $settings
+ *   - string $format_string_type
+ *     Which pattern is used by the format string. When using the
+ *     Intl formatter, the format string must use the Intl pattern,
+ *     which is different from the pattern used by the DateTime
+ *     format function. Defaults to DateTimePlus::PHP.
+ *   - string $country
+ *     The two letter country code to construct the locale string by the
+ *     intlDateFormatter class. Used to control the result of the
+ *     format() method if that class is available. Defaults to NULL.
+ *   - string $calendar
+ *     A calendar to use for the date, Defaults to the site
+ *     default calendar.
+ *   - int $date_type
+ *     The datetype to use in the formatter, defaults to
+ *     IntlDateFormatter::FULL.
+ *   - int $time_type
+ *     The datetype to use in the formatter, defaults to
+ *     IntlDateFormatter::FULL.
+ *   - boolean $lenient
+ *     Whether or not to use lenient processing in the intl
+ *     formatter. Defaults to FALSE;
  *
  * @return
  *   A translated date string in the requested format.
  */
-function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) {
+function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL, $settings = array()) {
+
   // Use the advanced drupal_static() pattern, since this is called very often.
   static $drupal_static_fast;
   if (!isset($drupal_static_fast)) {
     $drupal_static_fast['timezones'] = &drupal_static(__FUNCTION__);
   }
   $timezones = &$drupal_static_fast['timezones'];
+  $timezone = !empty($timezone) ? $timezone : date_default_timezone_get();
 
-  if (!isset($timezone)) {
-    $timezone = date_default_timezone_get();
-  }
   // Store DateTimeZone objects in an array rather than repeatedly
   // constructing identical objects over the life of a request.
   if (!isset($timezones[$timezone])) {
@@ -1921,45 +1943,72 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
     $langcode = language(LANGUAGE_TYPE_INTERFACE)->langcode;
   }
 
+  if (empty($settings['calendar'])) {
+    $settings['calendar'] = config('system.calendar')->get('calendar');
+  }
+
+  // Adjust $settings to include all the values the Dateobject will need.
+  $settings += array(
+    'timezone' => $timezone,
+    'langcode' => $langcode,
+  );
+
+  // Format strings and settings differ for the IntlDateFormatter
+  // and the normal PHP format() method.
+  $intl_format = '';
+  $intl_type = '';
+
   switch ($type) {
     case 'short':
       $format = variable_get('date_format_short', 'm/d/Y - H:i');
+      $intl_format = '';
+      $intl_type = 'SHORT';
       break;
 
     case 'long':
       $format = variable_get('date_format_long', 'l, F j, Y - H:i');
+      $intl_format = '';
+      $intl_type = 'LONG';
       break;
 
     case 'html_datetime':
       $format = variable_get('date_format_html_datetime', 'Y-m-d\TH:i:sO');
+      $intl_format = "yyyy-MM-dd'Tkk:mm:ssZZ";
       break;
 
     case 'html_date':
       $format = variable_get('date_format_html_date', 'Y-m-d');
+      $intl_format = "yyyy-MM-dd";
       break;
 
     case 'html_time':
       $format = variable_get('date_format_html_time', 'H:i:s');
+      $intl_format = "H:mm:ss";
       break;
 
     case 'html_yearless_date':
       $format = variable_get('date_format_html_yearless_date', 'm-d');
+      $intl_format = "MM-d";
       break;
 
     case 'html_week':
       $format = variable_get('date_format_html_week', 'Y-\WW');
+      $intl_format = "Y-'WW";
       break;
 
     case 'html_month':
       $format = variable_get('date_format_html_month', 'Y-m');
+      $intl_format = "Y-MM";
       break;
 
     case 'html_year':
       $format = variable_get('date_format_html_year', 'Y');
+      $intl_format = "Y";
       break;
 
     case 'custom':
       // No change to format.
+      $intl_format = $format;
       break;
 
     case 'medium':
@@ -1967,34 +2016,44 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
       // Retrieve the format of the custom $type passed.
       if ($type != 'medium') {
         $format = variable_get('date_format_' . $type, '');
+        $intl_format = $format;
       }
       // Fall back to 'medium'.
       if ($format === '') {
         $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
+        $intl_format = '';
+        $intl_type = 'MEDIUM';
       }
       break;
   }
 
-  // Create a DateTime object from the timestamp.
-  $date_time = date_create('@' . $timestamp);
-  // Set the time zone for the DateTime object.
-  date_timezone_set($date_time, $timezones[$timezone]);
-
-  // Encode markers that should be translated. 'A' becomes '\xEF\AA\xFF'.
-  // xEF and xFF are invalid UTF-8 sequences, and we assume they are not in the
-  // input string.
-  // Paired backslashes are isolated to prevent errors in read-ahead evaluation.
-  // The read-ahead expression ensures that A matches, but not \A.
-  $format = preg_replace(array('/\\\\\\\\/', '/(?<!\\\\)([AaeDlMTF])/'), array("\xEF\\\\\\\\\xFF", "\xEF\\\\\$1\$1\xFF"), $format);
-
-  // Call date_format().
-  $format = date_format($date_time, $format);
+  // Fix settings for the IntlDateFormatter.
+  // We can only use these constants if the IntlDateFormatter
+  // exists.
+  if (class_exists('IntlDateFormatter')) {
+    switch ($intl_type) {
+      case 'SHORT':
+        $settings['date_type'] = IntlDateFormatter::SHORT;
+        $settings['time_type'] = IntlDateFormatter::SHORT;
+        break;
+      case 'MEDIUM':
+        $settings['date_type'] = IntlDateFormatter::MEDIUM;
+        $settings['time_type'] = IntlDateFormatter::SHORT;
+        break;
+      case 'LONG':
+        $settings['date_type'] = IntlDateFormatter::LONG;
+        $settings['time_type'] = IntlDateFormatter::SHORT;
+        break;
+    }
+    $format = $intl_format;
+    $settings['format_string_type'] = DrupalDateTime::INTL;
+  }
 
-  // Pass the langcode to _format_date_callback().
-  _format_date_callback(NULL, $langcode);
+  // Create a DrupalDateTime object from the timestamp and timezone.
+  $date = new \Drupal\Core\Datetime\DrupalDateTime($timestamp, $timezones[$timezone]);
 
-  // Translate the marked sequences.
-  return preg_replace_callback('/\xEF([AaeDlMTF]?)(.*?)\xFF/', '_format_date_callback', $format);
+  // Call $date->format().
+  return $date->format($format, $settings);
 }
 
 /**
@@ -4974,7 +5033,8 @@ function drupal_page_set_cache($body) {
       $cache->data['headers'][$header_names[$name_lower]] = $value;
       if ($name_lower == 'expires') {
         // Use the actual timestamp from an Expires header if available.
-        $cache->expire = strtotime($value);
+        $date = new DrupalDateTime($value);
+        $cache->expire = $date->getTimestamp();
       }
     }
 
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 49ace44..71bd93d 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -2951,12 +2951,19 @@ function theme_date($variables) {
  * Expands a date element into year, month, and day select elements.
  */
 function form_process_date($element) {
+  $calendar = system_calendar();
+
+  // If empty, this will default to the current date.
+  // Using the full path to the class so we don't have to use
+  // this file unless needed.
+  $date = new \Drupal\Core\Datetime\DrupalDateTime($element['#value']);
+
   // Default to current date
   if (empty($element['#value'])) {
     $element['#value'] = array(
-      'day' => format_date(REQUEST_TIME, 'custom', 'j'),
-      'month' => format_date(REQUEST_TIME, 'custom', 'n'),
-      'year' => format_date(REQUEST_TIME, 'custom', 'Y'),
+      'day' => $date->format('j'),
+      'month' => $date->format('n'),
+      'year' => $date->format('Y'),
     );
   }
 
@@ -2975,17 +2982,17 @@ function form_process_date($element) {
   foreach ($order as $type) {
     switch ($type) {
       case 'day':
-        $options = drupal_map_assoc(range(1, 31));
+        $options = $calendar->days($element['#required']);
         $title = t('Day');
         break;
 
       case 'month':
-        $options = drupal_map_assoc(range(1, 12), 'map_month');
+        $options = $calendar->months_names_abbr($element['#required']);
         $title = t('Month');
         break;
 
       case 'year':
-        $options = drupal_map_assoc(range(1900, 2050));
+        $options = $calendar->years(1900, 2050, $element['#required']);
         $title = t('Year');
         break;
     }
@@ -3007,35 +3014,13 @@ function form_process_date($element) {
  * Validates the date type to prevent invalid dates (e.g., February 30, 2006).
  */
 function date_validate($element) {
-  if (!checkdate($element['#value']['month'], $element['#value']['day'], $element['#value']['year'])) {
+  $date = new \Drupal\Core\Datetime\DrupalDateTime($element['#value']);
+  if ($date->hasErrors()) {
     form_error($element, t('The specified date is invalid.'));
   }
 }
 
 /**
- * Renders a month name for display.
- *
- * Callback for drupal_map_assoc() within form_process_date().
- */
-function map_month($month) {
-  $months = &drupal_static(__FUNCTION__, array(
-    1 => 'Jan',
-    2 => 'Feb',
-    3 => 'Mar',
-    4 => 'Apr',
-    5 => 'May',
-    6 => 'Jun',
-    7 => 'Jul',
-    8 => 'Aug',
-    9 => 'Sep',
-    10 => 'Oct',
-    11 => 'Nov',
-    12 => 'Dec',
-  ));
-  return t($months[$month]);
-}
-
-/**
  * Sets the value for a weight element, with zero as a default.
  */
 function weight_value(&$form) {
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index cc29a98..d63215a 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1479,7 +1479,7 @@ function template_preprocess_datetime(&$variables) {
   // Format the 'datetime' attribute based on the timestamp.
   // @see http://www.w3.org/TR/html5-author/the-time-element.html#attr-time-datetime
   if (!isset($variables['attributes']['datetime']) && isset($variables['timestamp'])) {
-    $variables['attributes']['datetime'] = format_date($variables['timestamp'], 'html_datetime', '', 'UTC');
+    $variables['attributes']['datetime'] = format_date($variables['timestamp'], 'html_datetime', '', 'UTC'));
   }
 
   // If no text was provided, try to auto-generate it.
diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
new file mode 100644
index 0000000..289d6c0
--- /dev/null
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
@@ -0,0 +1,739 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Component\Datetime\DateTimePlus
+ */
+namespace Drupal\Component\Datetime;
+
+/**
+ * This class is an extension of the PHP DateTime class.
+ *
+ * It extends the PHP DateTime class with more flexible initialization
+ * parameters, allowing a date to be created from an existing date object,
+ * a timestamp, a string with an unknown format, a string with a known
+ * format, or an array of date parts. It also adds an errors array
+ * and a __toString() method to the date object.
+ *
+ * In addition, it swaps the IntlDateFormatter into the format() method,
+ * if it is available. The format() method is also extended with a settings
+ * array to provide settings needed by the IntlDateFormatter. It will
+ * will only be used if the class is available, a langcode, country, and
+ * calendar have been set, and the format is in the right pattern, otherwise
+ * the parent format() method is used in the usual way. These values can
+ * either be set globally in the object and reused over and over as the date
+ * is repeatedly formatted, or set specifically in the format() method
+ * for the requested format.
+ *
+ * This class is less lenient than the parent DateTime class. It changes
+ * the default behavior for handling date values like '2011-00-00'.
+ * The parent class would convert that value to '2010-11-30' and report
+ * a warning but not an error. This extension treats that as an error.
+ *
+ * As with the base class, a date object may be created even if it has
+ * errors. It has an errors array attached to it that explains what the
+ * errors are. This is less disruptive than allowing datetime exceptions
+ * to abort processing. The calling script can decide what to do about
+ * errors by checking the hasErrors() method and using the messages in
+ * the errors array.
+ */
+class DateTimePlus extends \DateTime {
+
+  const FORMAT   = 'Y-m-d H:i:s';
+  const CALENDAR = 'gregorian';
+  const PHP      = 'php';
+  const INTL     = 'intl';
+
+  /**
+   * An array of possible date parts.
+   */
+  public static $date_parts = array(
+                               'year',
+                               'month',
+                               'day',
+                               'hour',
+                               'minute',
+                               'second',
+                              );
+
+  /**
+   * The value of the time value passed to the constructor.
+   */
+  public $input_time_raw = '';
+
+  /**
+   * The prepared time, without timezone, for this date.
+   */
+  public $input_time_adjusted = '';
+
+  /**
+   * The value of the timezone passed to the constructor.
+   */
+  public $input_timezone_raw = '';
+
+  /**
+   * The prepared timezone object used to construct this date.
+   */
+  public $input_timezone_adjusted = '';
+
+  /**
+   * The value of the format passed to the constructor.
+   */
+  public $input_format_raw = '';
+
+  /**
+   * The prepared format, if provided.
+   */
+  public $input_format_adjusted = '';
+
+  /**
+   * The value of the language code passed to the constructor.
+   */
+  public $langcode = NULL;
+
+  /**
+   * The value of the country code passed to the constructor.
+   */
+  public $country = NULL;
+
+  /**
+   * The value of the calendar setting passed to the constructor.
+   */
+  public $calendar = NULL;
+
+  /**
+   * An array of errors encountered when creating this date.
+   */
+  public $errors = array();
+
+  /**
+   * Constructs a date object set to a requested date and timezone.
+   *
+   * @param mixed $time
+   *   A DateTime object, a date/time string, a unix timestamp,
+   *   or an array of date parts, like ('year' => 2014, 'month => 4).
+   *   Defaults to 'now'.
+   * @param mixed $timezone
+   *   PHP DateTimeZone object, string or NULL allowed.
+   *   Defaults to NULL.
+   * @param string $format
+   *   PHP date() type format for parsing the input. This is recommended
+   *   for specialized input with a known format. If provided the
+   *   date will be created using the createFromFormat() method.
+   *   Defaults to NULL.
+   *   @see http://us3.php.net/manual/en/datetime.createfromformat.php
+   * @param array $settings
+   *   - boolean $validate_format
+   *     The format used in createFromFormat() allows slightly different
+   *     values than format(). If we use an input format that works in
+   *     both functions we can add a validation step to confirm that the
+   *     date created from a format string exactly matches the input.
+   *     We need to know if this can be relied on to do that validation.
+   *     Defaults to TRUE.
+   *   - string $langcode
+   *     The two letter language code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $country
+   *     The two letter country code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $calendar
+   *     A calendar name to use for the date, Defaults to
+   *     DateTimePlus::CALENDAR.
+   *   - boolean $debug
+   *     Leave evidence of the input values in the resulting object
+   *     for debugging purposes. Defaults to FALSE.
+   *
+   * @TODO
+   *   Potentially there will be additional ways to take advantage
+   *   of calendar in date handling in the future.
+   */
+  public function __construct($time = 'now', $timezone = NULL, $format = NULL, $settings = array()) {
+
+    // Unpack settings.
+    $this->validate_format = !empty($settings['validate_format']) ? $settings['validate_format'] : TRUE;
+    $this->langcode = !empty($settings['langcode']) ? $settings['langcode'] : NULL;
+    $this->country = !empty($settings['country']) ? $settings['country'] : NULL;
+    $this->calendar = !empty($settings['calendar']) ? $settings['calendar'] : static::CALENDAR;
+
+    // Store the original input so it is available for validation.
+    $this->input_time_raw = $time;
+    $this->input_timezone_raw = $timezone;
+    $this->input_format_raw = $format;
+
+    // Massage the input values as necessary.
+    $this->prepareTime($time);
+    $this->prepareTimezone($timezone);
+    $this->prepareFormat($format);
+
+    // Create a date as a clone of an input DateTime object.
+    if ($this->inputIsObject()) {
+      $this->constructFromObject();
+    }
+
+    // Create date from array of date parts.
+    elseif ($this->inputIsArray()) {
+      $this->constructFromArray();
+    }
+
+    // Create a date from a Unix timestamp.
+    elseif ($this->inputIsTimestamp()) {
+      $this->constructFromTimestamp();
+    }
+
+    // Create a date from a time string and an expected format.
+    elseif ($this->inputIsFormat()) {
+      $this->constructFromFormat();
+    }
+
+    // Create a date from any other input.
+    else {
+      $this->constructFallback();
+    }
+
+    // Clean up the error messages.
+    $this->getErrors();
+    $this->errors = array_unique($this->errors);
+
+    // Now that we've validated the input, clean up the extra values.
+    if (empty($settings['debug'])) {
+      unset(
+        $this->input_time_raw,
+        $this->input_time_adjusted,
+        $this->input_timezone_raw,
+        $this->input_timezone_adjusted,
+        $this->input_format_raw,
+        $this->input_format_adjusted,
+        $this->validate_format
+      );
+    }
+
+  }
+
+  /**
+   * Implementation of __toString() for dates. The base DateTime
+   * class does not implement this.
+   *
+   * @see https://bugs.php.net/bug.php?id=62911 and
+   * http://www.serverphorums.com/read.php?7,555645
+   */
+  public function __toString() {
+    $format = static::FORMAT;
+    return $this->format($format) . ' ' . $this->getTimeZone()->getName();
+  }
+
+  /**
+   * Prepare the input value before trying to use it.
+   * Can be overridden to handle special cases.
+   *
+   * @param mixed $time
+   *   An input value, which could be a timestamp, a string,
+   *   or an array of date parts.
+   */
+  public function prepareTime($time) {
+    $this->input_time_adjusted = $time;
+  }
+
+  /**
+   * Prepare the timezone before trying to use it.
+   * Most imporantly, make sure we have a valid timezone
+   * object before moving further.
+   *
+   * @param mixed $timezone
+   *   Either a timezone name or a timezone object or NULL.
+   */
+  public function prepareTimezone($timezone) {
+    // If the passed in timezone is a valid timezone object, use it.
+    if ($timezone instanceOf \DateTimezone) {
+      $timezone_adjusted = $timezone;
+    }
+
+    // When the passed-in time is a DateTime object with its own
+    // timezone, try to use the date's timezone.
+    elseif (empty($timezone) && $this->input_time_adjusted instanceOf \DateTime) {
+      $timezone_adjusted = $this->input_time_adjusted->getTimezone();
+    }
+
+    // Allow string timezone input, and create a timezone from it.
+    elseif (!empty($timezone) && is_string($timezone)) {
+      $timezone_adjusted = new \DateTimeZone($timezone);
+    }
+
+    // Default to the system timezone when not explicitly provided.
+    // If the system timezone is missing, use 'UTC'.
+    if (empty($timezone_adjusted) || !$timezone_adjusted instanceOf \DateTimezone) {
+      $system_timezone = date_default_timezone_get();
+      $timezone_name = !empty($system_timezone) ? $system_timezone : 'UTC';
+      $timezone_adjusted = new \DateTimeZone($timezone_name);
+    }
+
+    // We are finally certain that we have a usable timezone.
+    $this->input_timezone_adjusted = $timezone_adjusted;
+  }
+
+  /**
+   * Prepare the input format before trying to use it.
+   * Can be overridden to handle special cases.
+   *
+   * @param string $format
+   *   A PHP format string.
+   */
+  public function prepareFormat($format) {
+    $this->input_format_adjusted = $format;
+  }
+
+  /**
+   * Check if input is a DateTime object.
+   *
+   * @return boolean
+   *   TRUE if the input time is a DateTime object.
+   */
+  public function inputIsObject() {
+    return $this->input_time_adjusted instanceOf \DateTime;
+  }
+
+  /**
+   * Create a date object from an input date object.
+   */
+  public function constructFromObject() {
+    try {
+      $this->input_time_adjusted = $this->input_time_adjusted->format(static::FORMAT);
+      parent::__construct($this->input_time_adjusted, $this->input_timezone_adjusted);
+    }
+    catch (\Exception $e) {
+      $this->errors[] = $e->getMessage();
+    }
+  }
+
+  /**
+   * Check if input time seems to be a timestamp.
+   *
+   * Providing an input format will prevent ISO values without separators
+   * from being mis-interpreted as timestamps. Providing a format can also
+   * avoid interpreting a value like '2010' with a format of 'Y' as a
+   * timestamp. The 'U' format indicates this is a timestamp.
+   *
+   * @return boolean
+   *   TRUE if the input time is a timestamp.
+   */
+  public function inputIsTimestamp() {
+    return is_numeric($this->input_time_adjusted) && (empty($this->input_format_adjusted) || $this->input_format_adjusted == 'U');
+  }
+
+  /**
+   * Create a date object from timestamp input.
+   *
+   * The timezone for timestamps is always UTC. In this case the
+   * timezone we set controls the timezone used when displaying
+   * the value using format().
+   */
+  public function constructFromTimestamp() {
+    try {
+      parent::__construct('', $this->input_timezone_adjusted);
+      $this->setTimestamp($this->input_time_adjusted);
+    }
+    catch (\Exception $e) {
+      $this->errors[] = $e->getMessage();
+    }
+  }
+
+  /**
+   * Check if input is an array of date parts.
+   *
+   * @return boolean
+   *   TRUE if the input time is a DateTime object.
+   */
+  public function inputIsArray() {
+    return is_array($this->input_time_adjusted);
+  }
+
+  /**
+   * Create a date object from an array of date parts.
+   *
+   * Convert the input value into an ISO date, forcing a full ISO
+   * date even if some values are missing.
+   */
+  public function constructFromArray() {
+    try {
+      parent::__construct('', $this->input_timezone_adjusted);
+      $this->input_time_adjusted = static::prepareArray($this->input_time_adjusted, TRUE);
+      if (static::checkArray($this->input_time_adjusted)) {
+        // Even with validation, we can end up with a value that the
+        // parent class won't handle, like a year outside the range
+        // of -9999 to 9999, which will pass checkdate() but
+        // fail to construct a date object.
+        $this->input_time_adjusted = static::arrayToISO($this->input_time_adjusted);
+        parent::__construct($this->input_time_adjusted, $this->input_timezone_adjusted);
+      }
+      else {
+        throw new \Exception('The array contains invalid values.');
+      }
+    }
+    catch (\Exception $e) {
+      $this->errors[] = $e->getMessage();
+    }
+  }
+
+  /**
+   * Check if input is a string with an expected format.
+   *
+   * @return boolean
+   *   TRUE if the input time is a string with an expected format.
+   */
+  public function inputIsFormat() {
+    return is_string($this->input_time_adjusted) && !empty($this->input_format_adjusted);
+  }
+
+  /**
+   * Create a date object from an input format.
+   *
+   */
+  public function constructFromFormat() {
+    // Try to create a date from the format and use it if possible.
+    // A regular try/catch won't work right here, if the value is
+    // invalid it doesn't return an exception.
+    try {
+      parent::__construct('', $this->input_timezone_adjusted);
+      $date = parent::createFromFormat($this->input_format_adjusted, $this->input_time_adjusted, $this->input_timezone_adjusted);
+      if (!$date instanceOf \DateTime) {
+        throw new \Exception('The date cannot be created from a format.');
+      }
+      else {
+        $this->setTimestamp($date->getTimestamp());
+        $this->setTimezone($date->getTimezone());
+
+        try {
+          // The createFromFormat function is forgiving, it might
+          // create a date that is not exactly a match for the provided
+          // value, so test for that. For instance, an input value of
+          // '11' using a format of Y (4 digits) gets created as
+          // '0011' instead of '2011'.
+          // Use the parent::format() because we do not want to use
+          // the IntlDateFormatter here.
+          if ($this->validate_format && parent::format($this->input_format_adjusted) != $this->input_time_raw) {
+            throw new \Exception('The created date does not match the input value.');
+          }
+        }
+        catch (\Exception $e) {
+          $this->errors[] = $e->getMessage();
+        }
+      }
+    }
+    catch (\Exception $e) {
+      $this->errors[] = $e->getMessage();
+    }
+  }
+
+  /**
+   * Fallback construction for values that don't match any of the
+   * other patterns.
+   *
+   * Let the parent dateTime attempt to turn this string into a
+   * valid date.
+   */
+  public function constructFallback() {
+
+    try {
+      // One last test for invalid input before we try to construct
+      // a date. If the input contains totally bogus information
+      // it will blow up badly if we pass it to the constructor.
+      // The date_parse() function will tell us if the input
+      // makes sense.
+      if (!empty($this->input_time_adjusted)) {
+        $test = date_parse($this->input_time_adjusted);
+        if (!empty($test['errors'])) {
+          $this->errors[] = $test['errors'];
+        }
+      }
+
+      if (empty($this->errors)) {
+        @parent::__construct($this->input_time_adjusted, $this->input_timezone_adjusted);
+      }
+    }
+    catch (\Exception $e) {
+      dsm('HERE');
+      $this->errors[] = $e->getMessage();
+    }
+  }
+
+  /**
+   * Examine getLastErrors() and see what errors to report.
+   *
+   * We're interested in two kinds of errors: anything that DateTime
+   * considers an error, and also a warning that the date was invalid.
+   * PHP creates a valid date from invalid data with only a warning,
+   * 2011-02-30 becomes 2011-03-03, for instance, but we don't want that.
+   *
+   * @see http://us3.php.net/manual/en/time.getlasterrors.php
+   */
+  public function getErrors() {
+    $errors = $this->getLastErrors();
+    if (!empty($errors['errors'])) {
+      $this->errors += $errors['errors'];
+    }
+    // Most warnings are messages that the date could not be parsed
+    // which causes it to be altered. We're going to consider a warning
+    // as bad as an error.
+    if (!empty($errors['warnings'])) {
+      $this->errors[] = 'The date is invalid.';
+    }
+  }
+
+  /**
+   * Detect if there were errors in the processing of this date.
+   */
+  function hasErrors() {
+    if (count($this->errors)) {
+      return TRUE;
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * Creates an ISO date from an array of values.
+   *
+   * @param array $array
+   *   An array of date values keyed by date part.
+   * @param bool $force_valid_date
+   *   (optional) Whether to force a full date by filling in missing
+   *   values. Defaults to FALSE.
+   *
+   * @return string
+   *   The date as an ISO string.
+   */
+  public static function arrayToISO($array, $force_valid_date = FALSE) {
+    $array = static::prepareArray($array, $force_valid_date);
+    $input_time_adjusted = '';
+    if ($array['year'] !== '') {
+      $input_time_adjusted = static::datePad(intval($array['year']), 4);
+      if ($force_valid_date || $array['month'] !== '') {
+        $input_time_adjusted .= '-' . static::datePad(intval($array['month']));
+        if ($force_valid_date || $array['day'] !== '') {
+          $input_time_adjusted .= '-' . static::datePad(intval($array['day']));
+        }
+      }
+    }
+    if ($array['hour'] !== '') {
+      $input_time_adjusted .= $input_time_adjusted ? 'T' : '';
+      $input_time_adjusted .= static::datePad(intval($array['hour']));
+      if ($force_valid_date || $array['minute'] !== '') {
+        $input_time_adjusted .= ':' . static::datePad(intval($array['minute']));
+        if ($force_valid_date || $array['second'] !== '') {
+          $input_time_adjusted .= ':' . static::datePad(intval($array['second']));
+        }
+      }
+    }
+    return $input_time_adjusted;
+  }
+
+  /**
+   * Creates a complete array from a possibly incomplete array of date parts.
+   *
+   * @param array $array
+   *   An array of date values keyed by date part.
+   * @param bool $force_valid_date
+   *   (optional) Whether to force a valid date by filling in missing
+   *   values with valid values or just to use empty values instead.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   A complete array of date parts.
+   */
+  public static function prepareArray($array, $force_valid_date = FALSE) {
+    if ($force_valid_date) {
+      $now = new \DateTime();
+      $array += array(
+                 'year'   => $now->format('Y'),
+                 'month'  => 1,
+                 'day'    => 1,
+                 'hour'   => 0,
+                 'minute' => 0,
+                 'second' => 0,
+                );
+    }
+    else {
+      $array += array(
+                 'year'   => '',
+                 'month'  => '',
+                 'day'    => '',
+                 'hour'   => '',
+                 'minute' => '',
+                 'second' => '',
+                );
+    }
+    return $array;
+  }
+
+  /**
+   * Check that an array of date parts has a year, month, and day,
+   * and that those values create a valid date. If time is provided,
+   * verify that the time values are valid. Sort of an
+   * equivalent to checkdate().
+   *
+   * @param array $array
+   *   An array of datetime values keyed by date part.
+   *
+   * @return boolean
+   *   TRUE if the datetime parts contain valid values, otherwise FALSE.
+   */
+  public static function checkArray($array) {
+    $valid_date = FALSE;
+    $valid_input_time_adjusted = TRUE;
+    // Check for a valid date using checkdate(). Only values that
+    // meet that test are valid.
+    if (array_key_exists('year', $array) && array_key_exists('month', $array) && array_key_exists('day', $array)) {
+      if (@checkdate($array['month'], $array['day'], $array['year'])) {
+        $valid_date = TRUE;
+      }
+    }
+    // Testing for valid time is reversed. Missing time is OK,
+    // but incorrect values are not.
+    foreach (array('hour', 'minute', 'second') as $key) {
+      if (array_key_exists($key, $array)) {
+        $value = $array[$key];
+        switch ($value) {
+          case 'hour':
+            if (!preg_match('/^([1-2][0-3]|[01]?[0-9])$/', $value)) {
+              $valid_input_time_adjusted = FALSE;
+            }
+            break;
+          case 'minute':
+          case 'second':
+          default:
+            if (!preg_match('/^([0-5][0-9]|[0-9])$/', $value)) {
+              $valid_input_time_adjusted = FALSE;
+            }
+            break;
+        }
+      }
+    }
+    return $valid_date && $valid_input_time_adjusted;
+  }
+
+  /**
+   * Helper function to left pad date parts with zeros.
+   *
+   * Provided because this is needed so often with dates.
+   *
+   * @param int $value
+   *   The value to pad.
+   * @param int $size
+   *   (optional) Size expected, usually 2 or 4. Defaults to 2.
+   *
+   * @return string
+   *   The padded value.
+   */
+  public static function datePad($value, $size = 2) {
+    return sprintf("%0" . $size . "d", $value);
+  }
+
+
+  /**
+   * Test if the IntlDateFormatter is available and we have the
+   * right information to be able to use it.
+   */
+  function canUseIntl() {
+    return class_exists('IntlDateFormatter') && !empty($this->calendar) && !empty($this->langcode) && !empty($this->country);
+  }
+
+  /**
+   * Format the date for display.
+   *
+   * Use the IntlDateFormatter to display the format, if possible.
+   * Because the IntlDateFormatter is not always available, we
+   * add an optional array of settings that provides the information
+   * the IntlDateFormatter will need.
+   *
+   * @param string $format
+   *   A format string using either PHP's date() or the
+   *   IntlDateFormatter() format.
+   * @param array $settings
+   *   - string $format_string_type
+   *     Which pattern is used by the format string. When using the
+   *     Intl formatter, the format string must use the Intl pattern,
+   *     which is different from the pattern used by the DateTime
+   *     format function. Defaults to DateTimePlus::PHP.
+   *   - string $timezone
+   *     A timezone name. Defaults to the timezone of the date object.
+   *   - string $langcode
+   *     The two letter language code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $country
+   *     The two letter country code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $calendar
+   *     A calendar name to use for the date, Defaults to
+   *     DateTimePlus::CALENDAR.
+   *   - int $date_type
+   *     The date type to use in the formatter, defaults to
+   *     IntlDateFormatter::FULL.
+   *   - int $time_type
+   *     The date type to use in the formatter, defaults to
+   *     IntlDateFormatter::FULL.
+   *   - boolean $lenient
+   *     Whether or not to use lenient processing in the intl
+   *     formatter. Defaults to FALSE;
+   *
+   * @return string
+   *   The formatted value of the date.
+   *
+   * @TODO
+   *   Potentially there will be additional ways to take advantage
+   *   of calendar in date handling in the future.
+   */
+  function format($format, $settings = array()) {
+
+    // If there were construction errors, we can't format the date.
+    if ($this->hasErrors()) {
+      return;
+    }
+
+    $format_string_type = isset($settings['format_string_type']) ? $settings['format_string_type'] : static::PHP;
+    $langcode = !empty($settings['langcode']) ? $settings['langcode'] : $this->langcode;
+    $country = !empty($settings['country']) ? $settings['country'] : $this->country;
+    $calendar = !empty($settings['calendar']) ? $settings['calendar'] : $this->calendar;
+    $time_zone = !empty($settings['timezone']) ? $settings['timezone'] : $this->getTimezone()->getName();
+    $lenient  = !empty($settings['lenient'])  ? $settings['lenient']  : FALSE;
+
+    // Format the date and catch errors.
+    try {
+
+      // If we have what we need to use the IntlDateFormatter, do so.
+      if ($this->canUseIntl() && $format_string_type == static::INTL) {
+
+        // Construct the $locale variable needed by the IntlDateFormatter.
+        $locale = $langcode . '_' . $country;
+
+        // If we have information about a calendar, add it.
+        if (!empty($calendar) && $calendar != static::CALENDAR) {
+          $locale .= '@calendar=' . $calendar;
+        }
+
+        // If we're working with a non-gregorian calendar, indicate that.
+        $calendar_type = \IntlDateFormatter::GREGORIAN;
+        if ($calendar != SELF::CALENDAR) {
+          $calendar_type = \IntlDateFormatter::TRADITIONAL;
+        }
+
+        $date_type = !empty($settings['date_type']) ? $settings['date_type'] : \IntlDateFormatter::FULL;
+        $time_type = !empty($settings['time_type']) ? $settings['time_type'] : \IntlDateFormatter::FULL;
+        $formatter = new \IntlDateFormatter($locale, $date_type, $time_type, $time_zone, $calendar_type);
+        $formatter->setLenient($lenient);
+        $value = $formatter->format($format);
+      }
+
+      // Otherwise, use the parent method.
+      else {
+        $value = parent::format($format);
+      }
+    }
+    catch (\Exception $e) {
+      $this->errors[] = $e->getMessage();
+    }
+    return $value;
+  }
+}
diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
new file mode 100644
index 0000000..d917c3e
--- /dev/null
+++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
@@ -0,0 +1,178 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Datetime\DrupalDateTime.
+ */
+namespace Drupal\Core\Datetime;
+
+use Drupal\Component\Datetime\DateTimePlus;
+
+/**
+ * This class is an extension of the Drupal DateTimePlus class.
+ *
+ * This class extends the basic component and adds in Drupal-specific
+ * handling, like translation of the format() method and error
+ * messages.
+ *
+ * @see Drupal/Component/Datetime/DateTimePlus.php
+ */
+class DrupalDateTime extends DateTimePlus {
+
+  /**
+   * Constructs a date object.
+   *
+   * @param mixed $time
+   *   A DateTime object, a date/input_time_adjusted string, a unix timestamp,
+   *   or an array of date parts, like ('year' => 2014, 'month => 4).
+   *   Defaults to 'now'.
+   * @param mixed $timezone
+   *   PHP DateTimeZone object, string or NULL allowed.
+   *   Defaults to NULL.
+   * @param string $format
+   *   PHP date() type format for parsing the input. This is recommended
+   *   to use things like negative years, which php's parser fails on, or
+   *   any other specialized input with a known format. If provided the
+   *   date will be created using the createFromFormat() method.
+   *   Defaults to NULL.
+   *   @see http://us3.php.net/manual/en/datetime.createfromformat.php
+   * @param array $settings
+   *   - boolean $validate_format
+   *     The format used in createFromFormat() allows slightly different
+   *     values than format(). If we use an input format that works in
+   *     both functions we can add a validation step to confirm that the
+   *     date created from a format string exactly matches the input.
+   *     We need to know if this can be relied on to do that validation.
+   *     Defaults to TRUE.
+   *   - string $langcode
+   *     The two letter language code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $country
+   *     The two letter country code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $calendar
+   *     A calendar name to use for the date, Defaults to
+   *     DateTimePlus::CALENDAR.
+   *   - boolean $debug
+   *     Leave evidence of the input values in the resulting object
+   *     for debugging purposes. Defaults to FALSE.
+   *
+   * @TODO
+   *   Potentially there will be additional ways to take advantage
+   *   of calendar in date handling in the future.
+   */
+  public function __construct($time = 'now', $timezone = NULL, $format = NULL, $settings = array()) {
+
+    // We can set the langcode and country using Drupal values.
+    $settings['langcode'] = !empty($settings['langcode']) ? $settings['langcode'] : language(LANGUAGE_TYPE_INTERFACE)->langcode;
+    $settings['country'] = !empty($settings['country']) ? $settings['country'] : variable_get('site_default_country');
+
+    // Instantiate the parent class.
+    parent::__construct($time, $timezone, $format, $settings);
+
+  }
+
+  /**
+   * Override basic component timezone handling to use Drupal's
+   * knowledge of the preferred user timezone.
+   */
+  public function prepareTimezone($timezone) {
+    $user_timezone = drupal_get_user_timezone();
+    if (empty($timezone) && !empty($user_timezone)) {
+      $timezone = $user_timezone;
+    }
+    parent::prepareTimezone($timezone);
+  }
+
+  /**
+   * Format the date for display.
+   *
+   * Use the IntlDateFormatter to display the format, if available.
+   * Because the IntlDateFormatter is not always available, we
+   * need to know whether the $format string uses the standard
+   * format strings used by the date() function or the alternative
+   * format provided by the IntlDateFormatter.
+   *
+   * @param string $format
+   *   A format string using either date() or IntlDateFormatter()
+   *   format.
+   * @param array $settings
+   *   - string $format_string_type
+   *     Which pattern is used by the format string. When using the
+   *     Intl formatter, the format string must use the Intl pattern,
+   *     which is different from the pattern used by the DateTime
+   *     format function. Defaults to DateTimePlus::PHP.
+   *   - string $timezone
+   *     A timezone name. Defaults to the timezone of the date object.
+   *   - string $langcode
+   *     The two letter language code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $country
+   *     The two letter country code to construct the locale string by the
+   *     intlDateFormatter class. Used to control the result of the
+   *     format() method if that class is available. Defaults to NULL.
+   *   - string $calendar
+   *     A calendar name to use for the date, Defaults to
+   *     DateTimePlus::CALENDAR.
+   *   - int $datetype
+   *     The datetype to use in the formatter, defaults to
+   *     IntlDateFormatter::FULL.
+   *   - int $timetype
+   *     The datetype to use in the formatter, defaults to
+   *     IntlDateFormatter::FULL.
+   *   - boolean $lenient
+   *     Whether or not to use lenient processing in the intl
+   *     formatter. Defaults to FALSE;
+   *
+   * @return string
+   *   The formatted value of the date.
+   *
+   * @TODO
+   *   Potentially there will be additional ways to take advantage
+   *   of calendar in date handling in the future.
+   */
+  function format($format, $settings = array()) {
+
+    $format_string_type = isset($settings['format_string_type']) ? $settings['format_string_type'] : static::PHP;
+
+    $settings['langcode'] = !empty($settings['langcode']) ? $settings['langcode'] : $this->langcode;
+    $settings['country'] = !empty($settings['country']) ? $settings['country'] : $this->country;
+
+    // Format the date and catch errors.
+    try {
+
+      // If we have what we need to use the IntlDateFormatter, do so.
+      if ($this->canUseIntl() && $format_string_type == parent::INTL) {
+        $value = parent::format($format, $settings);
+      }
+
+      // Otherwise, use the default Drupal method.
+      else {
+
+        // Encode markers that should be translated. 'A' becomes
+        // '\xEF\AA\xFF'. xEF and xFF are invalid UTF-8 sequences,
+        // and we assume they are not in the input string.
+        // Paired backslashes are isolated to prevent errors in
+        // read-ahead evaluation. The read-ahead expression ensures that
+        // A matches, but not \A.
+        $format = preg_replace(array('/\\\\\\\\/', '/(?<!\\\\)([AaeDlMTF])/'), array("\xEF\\\\\\\\\xFF", "\xEF\\\\\$1\$1\xFF"), $format);
+
+        // Call date_format().
+        $format = parent::format($format);
+
+        // Pass the langcode to _format_date_callback().
+        _format_date_callback(NULL, $settings['langcode']);
+
+        // Translate the marked sequences.
+        $value = preg_replace_callback('/\xEF([AaeDlMTF]?)(.*?)\xFF/', '_format_date_callback', $format);
+      }
+    }
+    catch (\Exception $e) {
+      $this->errors[] = $e->getMessage();
+    }
+    return $value;
+  }
+}
diff --git a/core/lib/Drupal/Core/Datetime/Plugin/DateCalendar.php b/core/lib/Drupal/Core/Datetime/Plugin/DateCalendar.php
new file mode 100644
index 0000000..e445b41
--- /dev/null
+++ b/core/lib/Drupal/Core/Datetime/Plugin/DateCalendar.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Datetime\Plugin\DateCalendar.
+ */
+
+namespace Drupal\Core\Datetime\Plugin;
+
+use Drupal\Component\Plugin\PluginManagerBase;
+use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Core\Plugin\Discovery\HookDiscovery;
+
+/**
+ * Manages Date Calendar plugins.
+ *
+ * Calendar plugins are discovered by searching for implementations
+ * of hook_date_calendar_info().
+ */
+class DateCalendar extends PluginManagerBase {
+
+  const DEFAULT_CALENDAR = 'gregorian';
+
+  /**
+   * Constructor.
+   */
+  public function __construct() {
+    $this->discovery = new HookDiscovery('date_calendar_info');
+    $this->factory = new DefaultFactory($this->discovery);
+  }
+
+  /**
+   * Implements Drupal\Component\Plugin\PluginManagerInterface::createInstance().
+   *
+   * @param string $plugin_id
+   *   The id of a plugin, i.e. the calendar type.
+   * @param array $configuration
+   *   Not used in this plugin.
+   *
+   * @return Drupal\Core\TypedData\TypedDataInterface
+   */
+  public function createInstance($plugin_id, array $configuration = array()) {
+
+    // A missing or invalid calendar $plugin_id creates serious problems,
+    // so check first and swap in the known default calendar if the
+    // value won't work.
+    $plugins = array_keys($this->getDefinitions());
+    if (!in_array($plugin_id, $plugins)) {
+      watchdog('datetime', t("The system was unable to use the '@calendar' calendar. Using @default calendar instead.", array('@calendar' => $plugin_id, '@default' => self::DEFAULT_CALENDAR)));
+      $plugin_id = self::DEFAULT_CALENDAR;
+    }
+    return $this->factory->createInstance($plugin_id, $configuration);
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Datetime/Plugin/DateCalendarInterface.php b/core/lib/Drupal/Core/Datetime/Plugin/DateCalendarInterface.php
new file mode 100644
index 0000000..234557b
--- /dev/null
+++ b/core/lib/Drupal/Core/Datetime/Plugin/DateCalendarInterface.php
@@ -0,0 +1,269 @@
+<?php
+/**
+ * @file
+ * Definition of Drupal\Core\Datetime\Plugin\DateCalendarInterface.
+ *
+ * Lots of helpful functions for use in massaging dates,
+ * specific the the calendar system in use. The values include
+ * both translated and untranslated values.
+ *
+ * Untranslated values are useful as array keys and as css
+ * identifiers, and should be listed in English.
+ *
+ * Translated values are useful for display to the user. All
+ * values that need translation should be hard-coded so the translation
+ * system will be able to process them.
+ */
+namespace Drupal\Core\Datetime\Plugin;
+
+interface DateCalendarInterface  {
+
+  /**
+   * Constructs an untranslated array of month names.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names_untranslated();
+
+  /**
+   * Constructs an untranslated array of abbreviated month names.
+   *
+   * @return array
+   *   An array of month name abbreviations.
+   */
+  public static function month_names_abbr_untranslated();
+
+  /**
+   * Constructs an untranslated array of week days.
+   *
+   * @return array
+   *   An array of week day names
+   */
+  public static function week_days_untranslated();
+
+  /**
+   * Returns a translated array of month names.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names($required = FALSE);
+
+  /**
+   * Constructs a translated array of month name abbreviations
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of month abbreviations.
+   */
+  public static function month_names_abbr($required = FALSE);
+
+  /**
+   * Returns a translated array of week names.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day names
+   */
+  public static function week_days($required = FALSE);
+
+  /**
+   * Constructs a translated array of week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day abbreviations
+   */
+  public static function week_days_abbr($required = FALSE);
+
+  /**
+   * Constructs a translated array of 2-letter week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day 2 letter abbreviations
+   */
+  public static function week_days_abbr2($required = FALSE);
+
+  /**
+   * Constructs a translated array of 1-letter week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day 1 letter abbreviations
+   */
+  public static function week_days_abbr1($required = FALSE);
+
+  /**
+   * Reorders weekdays to match the first day of the week.
+   *
+   * @param array $weekdays
+   *   An array of weekdays.
+   *
+   * @return array
+   *   An array of weekdays reordered to match the first day of the week.
+   */
+  public static function week_days_ordered($weekdays);
+
+  /**
+   * Constructs an array of years in a specified range.
+   *
+   * @param int $min
+   *   The minimum year in the array.
+   * @param int $max
+   *   The maximum year in the array.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of years in the selected range.
+   */
+  public static function years($min = 0, $max = 0, $required = FALSE);
+
+  /**
+   * Constructs an array of days in a month.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $month
+   *   (optional) The month in which to find the number of days.
+   * @param int $year
+   *   (optional) The year in which to find the number of days.
+   *
+   * @return array
+   *   An array of days for the selected month.
+   */
+  public static function days($required = FALSE, $month = NULL, $year = NULL);
+
+  /**
+   * Constructs an array of hours.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the hours.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of hours in the selected format.
+   */
+  public static function hours($format = 'H', $required = FALSE);
+
+  /**
+   * Constructs an array of minutes.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the minutes.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $increment
+   *   A the integer value to increment the values. Defaults to 1.
+   *
+   * @return array
+   *   An array of minutes in the selected format.
+   */
+  public static function minutes($format = 'i', $required = FALSE, $increment = 1);
+
+  /**
+   * Constructs an array of seconds.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the seconds.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $increment
+   *   A the integer value to increment the values. Defaults to 1.
+   *
+   * @return array
+   *   An array of seconds in the selected format.
+   */
+  public static function seconds($format = 's', $required = FALSE, $increment = 1);
+
+  /**
+   * Constructs an array of AM and PM options.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of AM and PM options.
+   */
+  public static function ampm($required = FALSE);
+
+  /**
+   * Identifies the number of days in a month for a date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return integer
+   *   The number of days in the month.
+   */
+  public static function days_in_month($date = NULL);
+
+  /**
+   * Identifies the number of days in a year for a date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return integer
+   *   The number of days in the year.
+   */
+  public static function days_in_year($date = NULL);
+
+  /**
+   * Returns day of week for a given date (0 = Sunday).
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return int
+   *   The number of the day in the week.
+   */
+  public static function day_of_week($date = NULL);
+
+  /**
+   * Returns translated name of the day of week for a given date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   * @param string $abbr
+   *   (optional) Whether to return the abbreviated name for that day.
+   *   Defaults to TRUE.
+   *
+   * @return string
+   *   The name of the day in the week for that date.
+   */
+  public static function day_of_week_name($date = NULL, $abbr = TRUE);
+
+}
diff --git a/core/lib/Drupal/Core/Datetime/Plugin/Type/Gregorian.php b/core/lib/Drupal/Core/Datetime/Plugin/Type/Gregorian.php
new file mode 100644
index 0000000..8efbd55
--- /dev/null
+++ b/core/lib/Drupal/Core/Datetime/Plugin/Type/Gregorian.php
@@ -0,0 +1,522 @@
+<?php
+/**
+ * @file
+ * Definition of Drupal\Core\Datetime\Plugin\Type\Gregorian.
+ *
+ * Lots of helpful functions for use in massaging dates,
+ * specific the the calendar system in use. The values include
+ * both translated and untranslated values.
+ *
+ * Untranslated values are useful as array keys and as css
+ * identifiers, and should be listed in English.
+ *
+ * Translated values are useful for display to the user. All
+ * values that need translation should be hard-coded so the translation
+ * system will be able to process them.
+ */
+namespace Drupal\Core\Datetime\Plugin\Type;
+
+use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Datetime\Plugin\DateCalendarInterface;
+
+/**
+ * Defines a Gregorian Calendar implementation.
+ */
+class Gregorian implements DateCalendarInterface {
+
+  /**
+   * Constructs an untranslated array of month names.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names_untranslated() {
+    // Force the key to use the correct month value, rather than
+    // starting with zero.
+    return array(
+            1  => 'January',
+            2  => 'February',
+            3  => 'March',
+            4  => 'April',
+            5  => 'May',
+            6  => 'June',
+            7  => 'July',
+            8  => 'August',
+            9  => 'September',
+            10 => 'October',
+            11 => 'November',
+            12 => 'December',
+    );
+  }
+
+  /**
+   * Constructs an untranslated array of abbreviated month names.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names_abbr_untranslated() {
+    // Force the key to use the correct month value, rather than
+    // starting with zero.
+    return array(
+            1  => 'Jan',
+            2  => 'Feb',
+            3  => 'Mar',
+            4  => 'Apr',
+            5  => 'May',
+            6  => 'Jun',
+            7  => 'Jul',
+            8  => 'Aug',
+            9  => 'Sep',
+            10 => 'Oct',
+            11 => 'Nov',
+            12 => 'Dec',
+    );
+  }
+
+  /**
+   * Constructs an untranslated array of week days.
+   *
+   * @return array
+   *   An array of week day names
+   */
+  public static function week_days_untranslated() {
+    return array(
+            'Sunday',
+            'Monday',
+            'Tuesday',
+            'Wednesday',
+            'Thursday',
+            'Friday',
+            'Saturday',
+    );
+  }
+
+  /**
+   * Returns a translated array of month names.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names($required = FALSE) {
+    // Force the key to use the correct month value, rather than
+    // starting with zero.
+    $month_names = array(
+                    1  => t('January', array(), array('context' => 'Long month name')),
+                    2  => t('February', array(), array('context' => 'Long month name')),
+                    3  => t('March', array(), array('context' => 'Long month name')),
+                    4  => t('April', array(), array('context' => 'Long month name')),
+                    5  => t('May', array(), array('context' => 'Long month name')),
+                    6  => t('June', array(), array('context' => 'Long month name')),
+                    7  => t('July', array(), array('context' => 'Long month name')),
+                    8  => t('August', array(), array('context' => 'Long month name')),
+                    9  => t('September', array(), array('context' => 'Long month name')),
+                    10 => t('October', array(), array('context' => 'Long month name')),
+                    11 => t('November', array(), array('context' => 'Long month name')),
+                    12 => t('December', array(), array('context' => 'Long month name')),
+    );
+    $none = array('' => '');
+    return !$required ? $none + $month_names : $month_names;
+  }
+
+  /**
+   * Constructs a translated array of month name abbreviations
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of month abbreviations.
+   */
+  public static function month_names_abbr($required = FALSE) {
+    // Force the key to use the correct month value, rather than
+    // starting with zero.
+    $month_names = array(
+                    1  => t('Jan'),
+                    2  => t('Feb'),
+                    3  => t('Mar'),
+                    4  => t('Apr'),
+                    5  => t('May'),
+                    6  => t('Jun'),
+                    7  => t('Jul'),
+                    8  => t('Aug'),
+                    9  => t('Sep'),
+                    10 => t('Oct'),
+                    11 => t('Nov'),
+                    12 => t('Dec'),
+    );
+    $none = array('' => '');
+    return !$required ? $none + $month_names : $month_names;
+  }
+
+  /**
+   * Returns a translated array of week names.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day names
+   */
+  public static function week_days($required = FALSE) {
+    $weekdays = array(
+                 t('Sunday'),
+                 t('Monday'),
+                 t('Tuesday'),
+                 t('Wednesday'),
+                 t('Thursday'),
+                 t('Friday'),
+                 t('Saturday'),
+    );
+    $none = array('' => '');
+    return !$required ? $none + $weekdays : $weekdays;
+  }
+
+  /**
+   * Constructs a translated array of week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day abbreviations
+   */
+  public static function week_days_abbr($required = FALSE) {
+    $weekdays = array(
+                 t('Sun', array(), array('context' => 'Sunday abbreviation')),
+                 t('Mon', array(), array('context' => 'Monday abbreviation')),
+                 t('Tue', array(), array('context' => 'Tuesday abbreviation')),
+                 t('Wed', array(), array('context' => 'Wednesday abbreviation')),
+                 t('Thu', array(), array('context' => 'Thursday abbreviation')),
+                 t('Fri', array(), array('context' => 'Friday abbreviation')),
+                 t('Sat', array(), array('context' => 'Saturday abbreviation')),
+    );
+    $none = array('' => '');
+    return !$required ? $none + $weekdays : $weekdays;
+  }
+
+  /**
+   * Constructs a translated array of 2-letter week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day 2 letter abbreviations
+   */
+  public static function week_days_abbr2($required = FALSE) {
+    $weekdays = array(
+                 t('Su', array(), array('context' => 'Sunday 2 letter abbreviation')),
+                 t('Mo', array(), array('context' => 'Monday 2 letter abbreviation')),
+                 t('Tu', array(), array('context' => 'Tuesday 2 letter abbreviation')),
+                 t('We', array(), array('context' => 'Wednesday 2 letter abbreviation')),
+                 t('Th', array(), array('context' => 'Thursday 2 letter abbreviation')),
+                 t('Fr', array(), array('context' => 'Friday 2 letter abbreviation')),
+                 t('Sa', array(), array('context' => 'Saturday 2 letter abbreviation')),
+    );
+    $none = array('' => '');
+    return !$required ? $none + $weekdays : $weekdays;
+  }
+
+  /**
+   * Constructs a translated array of 1-letter week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day 1 letter abbreviations
+   */
+  public static function week_days_abbr1($required = FALSE) {
+    $weekdays = array(
+                 t('S', array(), array('context' => 'Sunday 1 letter abbreviation')),
+                 t('M', array(), array('context' => 'Monday 1 letter abbreviation')),
+                 t('T', array(), array('context' => 'Tuesday 1 letter abbreviation')),
+                 t('W', array(), array('context' => 'Wednesday 1 letter abbreviation')),
+                 t('T', array(), array('context' => 'Thursday 1 letter abbreviation')),
+                 t('F', array(), array('context' => 'Friday 1 letter abbreviation')),
+                 t('S', array(), array('context' => 'Saturday 1 letter abbreviation')),
+    );
+    $none = array('' => '');
+    return !$required ? $none + $weekdays : $weekdays;
+  }
+
+  /**
+   * Reorders weekdays to match the first day of the week.
+   *
+   * @param array $weekdays
+   *   An array of weekdays.
+   *
+   * @return array
+   *   An array of weekdays reordered to match the first day of the week.
+   */
+  public static function week_days_ordered($weekdays) {
+    $first_day = variable_get('date_first_day', 0);
+    if ($first_day > 0) {
+      for ($i = 1; $i <= $first_day; $i++) {
+        $last = array_shift($weekdays);
+        array_push($weekdays, $last);
+      }
+    }
+    return $weekdays;
+  }
+
+  /**
+   * Constructs an array of years in a specified range.
+   *
+   * @param int $min
+   *   The minimum year in the array.
+   * @param int $max
+   *   The maximum year in the array.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of years in the selected range.
+   */
+  public static function years($min = 0, $max = 0, $required = FALSE) {
+    // Ensure $min and $max are valid values.
+    if (empty($min)) {
+      $min = intval(date('Y', REQUEST_TIME) - 3);
+    }
+    if (empty($max)) {
+      $max = intval(date('Y', REQUEST_TIME) + 3);
+    }
+    $none = array(0 => '');
+    $range = drupal_map_assoc(range($min, $max));
+    return !$required ? $none + $range : $range;
+  }
+
+  /**
+   * Constructs an array of days in a month.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $month
+   *   (optional) The month in which to find the number of days.
+   * @param int $year
+   *   (optional) The year in which to find the number of days.
+   *
+   * @return array
+   *   An array of days for the selected month.
+   */
+  public static function days($required = FALSE, $month = NULL, $year = NULL) {
+    // If we have a month and year, find the right last day of the month.
+    if (!empty($month) && !empty($year)) {
+      $date = new DrupalDateTime($year . '-' . $month . '-01 00:00:00', 'UTC');
+      $max = $date->format('t');
+    }
+    // If there is no month and year given, default to 31.
+    if (empty($max)) {
+      $max = 31;
+    }
+    $none = array(0 => '');
+    $range = drupal_map_assoc(range(1, $max));
+    return !$required ? $none + $range : $range;
+  }
+
+
+  /**
+   * Constructs an array of hours.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the hours.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of hours in the selected format.
+   */
+  public static function hours($format = 'H', $required = FALSE) {
+    $hours = array();
+    if ($format == 'h' || $format == 'g') {
+      $min = 1;
+      $max = 12;
+    }
+    else {
+      $min = 0;
+      $max = 23;
+    }
+    for ($i = $min; $i <= $max; $i++) {
+      $formatted = ($format == 'H' || $format == 'h') ? DrupalDateTime::datePad($i) : $i;
+      $hours[$i] = $formatted;
+    }
+    $none = array('' => '');
+    return !$required ? $none + $hours : $hours;
+  }
+
+  /**
+   * Constructs an array of minutes.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the minutes.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $increment
+   *   A the integer value to increment the values. Defaults to 1.
+   *
+   * @return array
+   *   An array of minutes in the selected format.
+   */
+  public static function minutes($format = 'i', $required = FALSE, $increment = 1) {
+    $minutes = array();
+    // Ensure $increment has a value so we don't loop endlessly.
+    if (empty($increment)) {
+      $increment = 1;
+    }
+    for ($i = 0; $i < 60; $i += $increment) {
+      $formatted = $format == 'i' ? DrupalDateTime::datePad($i) : $i;
+      $minutes[$i] = $formatted;
+    }
+    $none = array('' => '');
+    return !$required ? $none + $minutes : $minutes;
+  }
+
+  /**
+   * Constructs an array of seconds.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the seconds.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $increment
+   *   A the integer value to increment the values. Defaults to 1.
+   *
+   * @return array
+   *   An array of seconds in the selected format.
+   */
+  public static function seconds($format = 's', $required = FALSE, $increment = 1) {
+    $seconds = array();
+    // Ensure $increment has a value so we don't loop endlessly.
+    if (empty($increment)) {
+      $increment = 1;
+    }
+    for ($i = 0; $i < 60; $i += $increment) {
+      $formatted = $format == 's' ? DrupalDateTime::datePad($i) : $i;
+      $seconds[$i] = $formatted;
+    }
+    $none = array('' => '');
+    return !$required ? $none + $seconds : $seconds;
+  }
+
+  /**
+   * Constructs an array of AM and PM options.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of AM and PM options.
+   */
+  public static function ampm($required = FALSE) {
+    $none = array('' => '');
+    $ampm = array(
+             'am' => t('am', array(), array('context' => 'ampm')),
+             'pm' => t('pm', array(), array('context' => 'ampm')),
+    );
+    return !$required ? $none + $ampm : $ampm;
+  }
+
+  /**
+   * Identifies the number of days in a month for a date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return integer
+   *   The number of days in the month.
+   */
+  public static function days_in_month($date = NULL) {
+    if (!$date instanceOf DrupalDateTime) {
+      $date = new DrupalDateTime($date);
+    }
+    if (!$date->hasErrors()) {
+      return $date->format('t');
+    }
+    return NULL;
+  }
+
+  /**
+   * Identifies the number of days in a year for a date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return integer
+   *   The number of days in the year.
+   */
+  public static function days_in_year($date = NULL) {
+    if (!$date instanceOf DrupalDateTime) {
+      $date = new DrupalDateTime($date);
+    }
+    if (!$date->hasErrors()) {
+      if ($date->format('L')) {
+        return 366;
+      }
+      else {
+        return 365;
+      }
+    }
+    return NULL;
+  }
+
+  /**
+   * Returns day of week for a given date (0 = Sunday).
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return int
+   *   The number of the day in the week.
+   */
+  public static function day_of_week($date = NULL) {
+    if (!$date instanceOf DrupalDateTime) {
+      $date = new DrupalDateTime($date);
+    }
+    if (!$date->hasErrors()) {
+      return $date->format('w');
+    }
+    return NULL;
+  }
+
+  /**
+   * Returns translated name of the day of week for a given date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   * @param string $abbr
+   *   (optional) Whether to return the abbreviated name for that day.
+   *   Defaults to TRUE.
+   *
+   * @return string
+   *   The name of the day in the week for that date.
+   */
+  public static function day_of_week_name($date = NULL, $abbr = TRUE) {
+    if (!$date instanceOf DrupalDateTime) {
+      $date = new DrupalDateTime($date);
+    }
+    $dow = self::day_of_week($date);
+    $days = $abbr ? self::week_days_abbr() : self::week_days();
+    return $days[$dow];
+  }
+
+}
diff --git a/core/lib/Drupal/Core/TypedData/Type/Date.php b/core/lib/Drupal/Core/TypedData/Type/Date.php
index 07767e9..ae54856 100644
--- a/core/lib/Drupal/Core/TypedData/Type/Date.php
+++ b/core/lib/Drupal/Core/TypedData/Type/Date.php
@@ -7,16 +7,17 @@
 
 namespace Drupal\Core\TypedData\Type;
 
+use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\TypedData\TypedDataInterface;
-use DateTime;
 use InvalidArgumentException;
 
 /**
  * The date data type.
  *
- * The plain value of a date is an instance of the DateTime class. For setting
- * the value an instance of the DateTime class, any string supported by
- * DateTime::__construct(), or a timestamp as integer may be passed.
+ * The plain value of a date is an instance of the DrupalDateTime class. For setting
+ * the value any value supported by the __construct() of the DrupalDateTime
+ * class will work, including a DateTime object, a timestamp, a string
+ * date, or an array of date parts.
  */
 class Date extends TypedData implements TypedDataInterface {
 
@@ -31,18 +32,17 @@ class Date extends TypedData implements TypedDataInterface {
    * Implements TypedDataInterface::setValue().
    */
   public function setValue($value) {
-    if ($value instanceof DateTime || !isset($value)) {
+
+    // Don't try to create a date from an empty value.
+    // It would default to the current time.
+    if (!isset($value)) {
       $this->value = $value;
     }
-    // Treat integer values as timestamps, even if supplied as PHP string.
-    elseif ((string) (int) $value === (string) $value) {
-      $this->value = new DateTime('@' . $value);
-    }
-    elseif (is_string($value)) {
-      $this->value = new DateTime($value);
-    }
     else {
-      throw new InvalidArgumentException("Invalid date format given.");
+      $this->value = $value instanceOf DrupalDateTime ? $value : new DrupalDateTime($value);
+      if ($this->value->hasErrors()) {
+        throw new InvalidArgumentException("Invalid date format given.");
+      }
     }
   }
 
@@ -50,7 +50,7 @@ public function setValue($value) {
    * Implements TypedDataInterface::getString().
    */
   public function getString() {
-    return (string) $this->getValue()->format(DateTime::ISO8601);
+    return (string) $this->getValue()->__toString();
   }
 
   /**
diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
index cead0cd..3b9fa9b 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment;
 
+use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityFormController;
 
@@ -236,7 +237,8 @@ public function validate(array $form, array &$form_state) {
       $account = user_load_by_name($form_state['values']['name']);
       $form_state['values']['uid'] = $account ? $account->uid : 0;
 
-      if ($form_state['values']['date'] && strtotime($form_state['values']['date']) === FALSE) {
+      $date = new DrupalDateTime($form_state['values']['date']);
+      if ($date->hasErrors()) {
         form_set_error('date', t('You have to specify a valid date.'));
       }
       if ($form_state['values']['name'] && !$form_state['values']['is_anonymous'] && !$account) {
@@ -271,7 +273,8 @@ public function submit(array $form, array &$form_state) {
     if (empty($comment->date)) {
       $comment->date = 'now';
     }
-    $comment->created = strtotime($comment->date);
+    $date = new DrupalDateTime($comment->date);
+    $comment->created = $date->getTimestamp();
     $comment->changed = REQUEST_TIME;
 
     // If the comment was posted by a registered user, assign the author's ID.
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 5add3df..ff7c775 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node;
 
+use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityFormController;
 
@@ -288,7 +289,8 @@ public function validate(array $form, array &$form_state) {
     }
 
     // Validate the "authored on" field.
-    if (!empty($node->date) && strtotime($node->date) === FALSE) {
+    $date = new DrupalDateTime($node->date);
+    if ($date->hasErrors()) {
       form_set_error('date', t('You have to specify a valid date.'));
     }
 
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 55989de..d2b6a15 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -14,6 +14,7 @@
 use Drupal\Core\Database\Query\AlterableInterface;
 use Drupal\Core\Database\Query\SelectExtender;
 use Drupal\Core\Database\Query\SelectInterface;
+use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Template\Attribute;
 use Drupal\node\Node;
 use Drupal\file\File;
@@ -1070,7 +1071,8 @@ function node_submit(Node $node) {
     $node->revision_uid = $user->uid;
   }
 
-  $node->created = !empty($node->date) ? strtotime($node->date) : REQUEST_TIME;
+  $node_created = new DrupalDateTime(!empty($node->date) ? $node->date : REQUEST_TIME);
+  $node->created = $node_created->getTimestamp();
   $node->validated = TRUE;
 
   return $node;
diff --git a/core/modules/system/config/system.calendar.yml b/core/modules/system/config/system.calendar.yml
new file mode 100644
index 0000000..a711b76
--- /dev/null
+++ b/core/modules/system/config/system.calendar.yml
@@ -0,0 +1 @@
+calendar: gregorian
diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DateCalendarTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DateCalendarTest.php
new file mode 100644
index 0000000..346abf9
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DateCalendarTest.php
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Datetime\DateCalendarTest.
+ */
+
+namespace Drupal\system\Tests\Datetime;
+
+use Drupal\simpletest\WebTestBase;
+use Drupal\Core\Datetime\Plugin\DateCalendar;
+
+class DateCalendarTest extends WebTestBase {
+
+  /**
+   * Test information.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Date Calendar',
+      'description' => 'Test Date Calendar functionality.',
+      'group' => 'Datetime',
+    );
+  }
+
+  /**
+   * Set up required modules.
+   */
+  public static $modules = array('datetime_test');
+
+  /**
+   * Test setup.
+   */
+  public function setUp() {
+    parent::setUp();
+  }
+
+  /**
+   * Test .
+   */
+  public function testDateCalendar() {
+
+    // Test gregorian system calendar.
+    $plugin = new DateCalendar();
+    $calendar = $plugin->createInstance('gregorian');
+    $this->assertTrue(in_array('January', $calendar->month_names()), 'The gregorian calendar can be loaded.');
+
+    // Test alternate 'Gamma' calendar.
+    $plugin = new DateCalendar();
+    $options = $plugin->getDefinitions();
+    $this->assertTrue(array_key_exists('gamma', $options), 'An alternate calendar can be found.');
+
+    $calendar = $plugin->createInstance('gamma');
+    $this->assertTrue(in_array('Alpha', $calendar->month_names()), 'An alternate calendar can be loaded.');
+
+    // Test that a bogus calendar is switched to gregorian.
+    $plugin = new DateCalendar();
+    $calendar = $plugin->createInstance('bogus');
+    $this->assertTrue(in_array('January', $calendar->month_names()), 'A nonexisting calendar is replaced with the gregorian calendar.');
+
+
+  }
+
+  /**
+   * Tear down after tests.
+   */
+  public function tearDown() {
+    parent::tearDown();
+  }
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusTest.php
new file mode 100644
index 0000000..a76e988
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusTest.php
@@ -0,0 +1,436 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Datetime\DateTimePlusTest.
+ */
+
+namespace Drupal\system\Tests\Datetime;
+
+use Drupal\simpletest\WebTestBase;
+use Drupal\Component\Datetime\DateTimePlus;
+use DateTimeZone;
+
+class DateTimePlusTest extends WebTestBase {
+
+  /**
+   * Test information.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'DateTimePlus',
+      'description' => 'Test DateTimePlus functionality.',
+      'group' => 'Datetime',
+    );
+  }
+
+  /**
+   * Set up required modules.
+   */
+  public static $modules = array();
+
+  /**
+   * Test setup.
+   */
+  public function setUp() {
+    parent::setUp();
+    variable_set('date_first_day', 1);
+  }
+
+  /**
+   * Test creating dates from string input.
+   */
+  public function testDateStrings() {
+
+    // Create date object from datetime string.
+    $input = '2009-03-07 10:30';
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2009-03-07T10:30:00-06:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+    // Same during daylight savings time.
+    $input = '2009-06-07 10:30';
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2009-06-07T10:30:00-05:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+    // Create date object from date string.
+    $input = '2009-03-07';
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2009-03-07T00:00:00-06:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+    // Same during daylight savings time.
+    $input = '2009-06-07';
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2009-06-07T00:00:00-05:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+    // Create date object from date string.
+    $input = '2009-03-07 10:30';
+    $timezone = 'Australia/Canberra';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2009-03-07T10:30:00+11:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+    // Same during daylight savings time.
+    $input = '2009-06-07 10:30';
+    $timezone = 'Australia/Canberra';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2009-06-07T10:30:00+10:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+  }
+
+  /**
+   * Test creating dates from arrays of date parts.
+   */
+  function testDateArrays() {
+
+    // Create date object from date array, date only.
+    $input = array('year' => 2010, 'month' => 2, 'day' => 28);
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2010-02-28T00:00:00-06:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus(array('year' => 2010, 'month' => 2, 'day' => 28), $timezone): should be $expected, found $value.");
+
+    // Create date object from date array with hour.
+    $input = array('year' => 2010, 'month' => 2, 'day' => 28, 'hour' => 10);
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2010-02-28T10:00:00-06:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus(array('year' => 2010, 'month' => 2, 'day' => 28, 'hour' => 10), $timezone): should be $expected, found $value.");
+
+    // Create date object from date array, date only.
+    $input = array('year' => 2010, 'month' => 2, 'day' => 28);
+    $timezone = 'Europe/Berlin';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2010-02-28T00:00:00+01:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus(array('year' => 2010, 'month' => 2, 'day' => 28), $timezone): should be $expected, found $value.");
+
+    // Create date object from date array with hour.
+    $input = array('year' => 2010, 'month' => 2, 'day' => 28, 'hour' => 10);
+    $timezone = 'Europe/Berlin';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '2010-02-28T10:00:00+01:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus(array('year' => 2010, 'month' => 2, 'day' => 28, 'hour' => 10), $timezone): should be $expected, found $value.");
+
+
+  }
+
+  /**
+   * Test creating dates from timestamps.
+   */
+  function testDateTimestamp() {
+
+    // Create date object from a unix timestamp and display it in
+    // local time.
+    $input = 0;
+    $timezone = 'UTC';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '1970-01-01T00:00:00+00:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone): should be $expected, found $value.");
+
+    $expected = 'UTC';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone is $value: should be $expected.");
+    $expected = 0;
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset is $value: should be $expected.");
+
+    $timezone = 'America/Los_Angeles';
+    $date->setTimezone(new DateTimeZone($timezone));
+    $value = $date->format('c');
+    $expected = '1969-12-31T16:00:00-08:00';
+    $this->assertEqual($expected, $value, "Test \$date->setTimezone(new DateTimeZone($timezone)): should be $expected, found $value.");
+
+    $expected = 'America/Los_Angeles';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '-28800';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+
+    // Create a date using the timestamp of zero, then display its
+    // value both in UTC and the local timezone.
+    $input = 0;
+    $timezone = 'America/Los_Angeles';
+    $date = new DateTimePlus($input, $timezone);
+    $offset = $date->getOffset();
+    $value = $date->format('c');
+    $expected = '1969-12-31T16:00:00-08:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone):  should be $expected, found $value.");
+
+    $expected = 'America/Los_Angeles';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '-28800';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+
+    $timezone = 'UTC';
+    $date->setTimezone(new DateTimeZone($timezone));
+    $value = $date->format('c');
+    $expected = '1970-01-01T00:00:00+00:00';
+    $this->assertEqual($expected, $value, "Test \$date->setTimezone(new DateTimeZone($timezone)): should be $expected, found $value.");
+
+    $expected = 'UTC';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '0';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+  }
+
+  /**
+   * Test timezone manipulation.
+   */
+  function testTimezoneConversion() {
+
+    // Create date object from datetime string in UTC, and convert
+    // it to a local date.
+    $input = '1970-01-01 00:00:00';
+    $timezone = 'UTC';
+    $date = new DateTimePlus($input, $timezone);
+    $value = $date->format('c');
+    $expected = '1970-01-01T00:00:00+00:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus('$input', '$timezone'): should be $expected, found $value.");
+
+    $expected = 'UTC';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone is $value: should be $expected.");
+    $expected = 0;
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset is $value: should be $expected.");
+
+    $timezone = 'America/Los_Angeles';
+    $date->setTimezone(new DateTimeZone($timezone));
+    $value = $date->format('c');
+    $expected = '1969-12-31T16:00:00-08:00';
+    $this->assertEqual($expected, $value, "Test \$date->setTimezone(new DateTimeZone($timezone)): should be $expected, found $value.");
+
+    $expected = 'America/Los_Angeles';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '-28800';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+
+    // Convert the local time to UTC using string input.
+    $input = '1969-12-31 16:00:00';
+    $timezone = 'America/Los_Angeles';
+    $date = new DateTimePlus($input, $timezone);
+    $offset = $date->getOffset();
+    $value = $date->format('c');
+    $expected = '1969-12-31T16:00:00-08:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus('$input', '$timezone'):  should be $expected, found $value.");
+
+    $expected = 'America/Los_Angeles';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '-28800';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+
+    $timezone = 'UTC';
+    $date->setTimezone(new DateTimeZone($timezone));
+    $value = $date->format('c');
+    $expected = '1970-01-01T00:00:00+00:00';
+    $this->assertEqual($expected, $value, "Test \$date->setTimezone(new DateTimeZone($timezone)): should be $expected, found $value.");
+
+    $expected = 'UTC';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '0';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+
+    // Convert the local time to UTC using string input.
+    $input = '1969-12-31 16:00:00';
+    $timezone = 'Europe/Warsaw';
+    $date = new DateTimePlus($input, $timezone);
+    $offset = $date->getOffset();
+    $value = $date->format('c');
+    $expected = '1969-12-31T16:00:00+01:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus('$input', '$timezone'):  should be $expected, found $value.");
+
+    $expected = 'Europe/Warsaw';
+    $value = $date->getTimeZone()->getName();
+    $this->assertEqual($expected, $value, "The current timezone should be $expected, found $value.");
+    $expected = '+3600';
+    $value = $date->getOffset();
+    $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
+
+
+  }
+
+  /**
+   * Test creating dates from format strings.
+   */
+  function testDateFormat() {
+
+     // Create a year-only date.
+    $input = '2009';
+    $timezone = NULL;
+    $format = 'Y';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $value = $date->format('Y');
+    $expected = '2009';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone, $format): should be $expected, found $value.");
+
+     // Create a month and year-only date.
+    $input = '2009-10';
+    $timezone = NULL;
+    $format = 'Y-m';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $value = $date->format('Y-m');
+    $expected = '2009-10';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone, $format): should be $expected, found $value.");
+
+     // Create a time-only date.
+    $input = 'T10:30:00';
+    $timezone = NULL;
+    $format = '\TH:i:s';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $value = $date->format('H:i:s');
+    $expected = '10:30:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone, $format): should be $expected, found $value.");
+
+     // Create a time-only date.
+    $input = '10:30:00';
+    $timezone = NULL;
+    $format = 'H:i:s';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $value = $date->format('H:i:s');
+    $expected = '10:30:00';
+    $this->assertEqual($expected, $value, "Test new DateTimePlus($input, $timezone, $format): should be $expected, found $value.");
+
+  }
+
+  /**
+   * Test invalid date handling.
+   */
+  function testInvalidDates() {
+
+    // Test for invalid month names when we are using a short version
+    // of the month.
+    $input = '23 abc 2012';
+    $timezone = NULL;
+    $format = 'd M Y';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $this->assertNotEqual(count($date->errors), 0, "$input contains an invalid month name and produces errors.");
+
+     // Test for invalid hour.
+    $input = '0000-00-00T45:30:00';
+    $timezone = NULL;
+    $format = 'Y-m-d\TH:i:s';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $this->assertNotEqual(count($date->errors), 0, "$input contains an invalid hour and produces errors.");
+
+     // Test for invalid day.
+    $input = '0000-00-99T05:30:00';
+    $timezone = NULL;
+    $format = 'Y-m-d\TH:i:s';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $this->assertNotEqual(count($date->errors), 0, "$input contains an invalid day and produces errors.");
+
+     // Test for invalid month.
+    $input = '0000-75-00T15:30:00';
+    $timezone = NULL;
+    $format = 'Y-m-d\TH:i:s';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $this->assertNotEqual(count($date->errors), 0, "$input contains an invalid month and produces errors.");
+
+     // Test for invalid year.
+    $input = '11-08-01T15:30:00';
+    $timezone = NULL;
+    $format = 'Y-m-d\TH:i:s';
+    $date = new DateTimePlus($input, $timezone, $format);
+    $this->assertNotEqual(count($date->errors), 0, "$input contains an invalid year and produces errors.");
+
+    // Test for invalid year from date array. 10000 as a year will
+    // create an exception error in the PHP DateTime object.
+    $input = array('year' => 10000, 'month' => 7, 'day' => 8, 'hour' => 8, 'minute' => 0, 'second' => 0);
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $this->assertNotEqual(count($date->errors), 0, "array('year' => 10000, 'month' => 7, 'day' => 8, 'hour' => 8, 'minute' => 0, 'second' => 0) contains an invalid year and produces errors.");
+
+    // Test for invalid month from date array.
+    $input = array('year' => 2010, 'month' => 27, 'day' => 8, 'hour' => 8, 'minute' => 0, 'second' => 0);
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $this->assertNotEqual(count($date->errors), 0, "array('year' => 2010, 'month' => 27, 'day' => 8, 'hour' => 8, 'minute' => 0, 'second' => 0) contains an invalid month and produces errors.");
+
+    // Test for invalid hour from date array.
+    $input = array('year' => 2010, 'month' => 2, 'day' => 28, 'hour' => 80, 'minute' => 0, 'second' => 0);
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $this->assertNotEqual(count($date->errors), 0, "array('year' => 2010, 'month' => 2, 'day' => 28, 'hour' => 80, 'minute' => 0, 'second' => 0) contains an invalid hour and produces errors.");
+
+    // Test for invalid minute from date array.
+    $input = array('year' => 2010, 'month' => 7, 'day' => 8, 'hour' => 8, 'minute' => 88, 'second' => 0);
+    $timezone = 'America/Chicago';
+    $date = new DateTimePlus($input, $timezone);
+    $this->assertNotEqual(count($date->errors), 0, "array('year' => 2010, 'month' => 7, 'day' => 8, 'hour' => 8, 'minute' => 88, 'second' => 0) contains an invalid minute and produces errors.");
+
+  }
+
+  /**
+   * Test that DrupalDateTime can detect the right timezone to use.
+   * When specified or not.
+   */
+  public function testDateTimezone() {
+    global $user;
+
+    $date_string = '2007-01-31 21:00:00';
+
+    // Detect the system timezone.
+    $system_timezone = date_default_timezone_get();
+
+    // Create a date object with an unspecified timezone, which should
+    // end up using the system timezone.
+    $date = new DateTimePlus($date_string);
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == $system_timezone, 'DateTimePlus uses the system timezone when there is no site timezone.');
+
+    // Create a date object with a specified timezone name.
+    $date = new DateTimePlus($date_string, 'America/Yellowknife');
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == 'America/Yellowknife', 'DateTimePlus uses the specified timezone if provided.');
+
+    // Create a date object with a timezone object.
+    $date = new DateTimePlus($date_string, new \DateTimeZone('Australia/Canberra'));
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == 'Australia/Canberra', 'DateTimePlus uses the specified timezone if provided.');
+
+    // Create a date object with another date object.
+    $new_date = new DateTimePlus('now', 'Pacific/Midway');
+    $date = new DateTimePlus($new_date);
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == 'Pacific/Midway', 'DateTimePlus uses the specified timezone if provided.');
+
+  }
+
+  /**
+   * Tear down after tests.
+   */
+  public function tearDown() {
+    variable_del('date_first_day');
+    parent::tearDown();
+  }
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
new file mode 100644
index 0000000..ea10896
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
@@ -0,0 +1,110 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Datetime\DateTimePlusTest.
+ */
+
+namespace Drupal\system\Tests\Datetime;
+
+use Drupal\simpletest\WebTestBase;
+use Drupal\Core\Datetime\DrupalDateTime;
+
+class DrupalDateTimeTest extends WebTestBase {
+
+  /**
+   * Test information.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'DrupalDateTime',
+      'description' => 'Test DrupalDateTime functionality.',
+      'group' => 'Datetime',
+    );
+  }
+
+  /**
+   * Set up required modules.
+   */
+  public static $modules = array();
+
+  /**
+   * Test setup.
+   */
+  public function setUp() {
+    parent::setUp();
+
+  }
+
+  /**
+   * Test that DrupalDateTime can detect the right timezone to use.
+   * Test with a variety of less commonly used timezone names to
+   * help ensure that the system timezone will be different than the
+   * stated timezones.
+   */
+  public function testDateTimezone() {
+    global $user;
+
+    $date_string = '2007-01-31 21:00:00';
+
+    // Make sure no site timezone has been set.
+    variable_set('date_default_timezone', NULL);
+    variable_set('configurable_timezones', 0);
+
+    // Detect the system timezone.
+    $system_timezone = date_default_timezone_get();
+
+    // Create a date object with an unspecified timezone, which should
+    // end up using the system timezone.
+    $date = new DrupalDateTime($date_string);
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == $system_timezone, 'DrupalDateTime uses the system timezone when there is no site timezone.');
+
+    // Create a date object with a specified timezone.
+    $date = new DrupalDateTime($date_string, 'America/Yellowknife');
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == 'America/Yellowknife', 'DrupalDateTime uses the specified timezone if provided.');
+
+    // Set a site timezone.
+    variable_set('date_default_timezone', 'Europe/Warsaw');
+
+    // Create a date object with an unspecified timezone, which should
+    // end up using the site timezone.
+    $date = new DrupalDateTime($date_string);
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == 'Europe/Warsaw', 'DrupalDateTime uses the site timezone if provided.');
+
+    // Create user.
+    variable_set('configurable_timezones', 1);
+    $test_user = $this->drupalCreateUser(array());
+    $this->drupalLogin($test_user);
+
+    // Set up the user with a different timezone than the site.
+    $edit = array('mail' => $test_user->mail, 'timezone' => 'Asia/Manila');
+    $this->drupalPost('user/' . $test_user->uid . '/edit', $edit, t('Save'));
+
+    // Disable session saving as we are about to modify the global $user.
+    drupal_save_session(FALSE);
+    // Save the original user and then replace it with the test user.
+    $real_user = $user;
+    $user = user_load($test_user->uid, TRUE);
+
+    // Simulate a Drupal bootstrap with the logged-in user.
+    date_default_timezone_set(drupal_get_user_timezone());
+
+    // Create a date object with an unspecified timezone, which should
+    // end up using the user timezone.
+
+    $date = new DrupalDateTime($date_string);
+    $timezone = $date->getTimezone()->getName();
+    $this->assertTrue($timezone == 'Asia/Manila', 'DrupalDateTime uses the user timezone, if configurable timezones are used and it is set.');
+
+    // Restore the original user, and enable session saving.
+    $user = $real_user;
+    // Restore default time zone.
+    date_default_timezone_set(drupal_get_user_timezone());
+    drupal_save_session(TRUE);
+
+
+  }
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php b/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php
index 62bd35e..00e4c95 100644
--- a/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php
@@ -8,7 +8,7 @@
 namespace Drupal\system\Tests\TypedData;
 
 use Drupal\simpletest\WebTestBase;
-use DateTime;
+use Drupal\Core\Datetime\DrupalDateTime;
 use DateInterval;
 
 /**
@@ -72,7 +72,7 @@ public function testGetAndSet() {
     $this->assertNull($wrapper->getValue(), 'Float wrapper is null-able.');
 
     // Date type.
-    $value = new DateTime('@' . REQUEST_TIME);
+    $value = new DrupalDateTime(REQUEST_TIME);
     $wrapper = $this->createTypedData(array('type' => 'date'), $value);
     $this->assertTrue($wrapper->getValue() === $value, 'Date value was fetched.');
     $new_value = REQUEST_TIME + 1;
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index c55289c..53d967c 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -8,6 +8,7 @@
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Drupal\Core\Datetime\DrupalDateTime;
 
 /**
  * Menu callback; Provide the administration overview page.
@@ -1861,6 +1862,11 @@ function system_regional_settings() {
   // Date settings:
   $zones = system_time_zones();
 
+  // Get calendar information.
+  $calendar_type = config('system.calendar')->get('calendar');
+  $calendar_plugin = new \Drupal\Core\Datetime\Plugin\DateCalendar();
+  $calendar = $calendar_plugin->createInstance($calendar_type);
+
   $form['locale'] = array(
     '#type' => 'fieldset',
     '#title' => t('Locale'),
@@ -1875,11 +1881,23 @@ function system_regional_settings() {
     '#attributes' => array('class' => array('country-detect')),
   );
 
+  // Find out what calendar systems are available.
+  foreach ($calendar_plugin->getDefinitions() as $name => $definition) {
+    $options[$name] = $definition['label'];
+  }
+  $form['locale']['calendar'] = array(
+    '#type' => 'select',
+    '#title' => t('Default calendar system'),
+    '#default_value' => $calendar_type,
+    '#options' => $options,
+  );
+
+  // Get a list of day names using the site calendar.
   $form['locale']['date_first_day'] = array(
     '#type' => 'select',
     '#title' => t('First day of week'),
     '#default_value' => variable_get('date_first_day', 0),
-    '#options' => array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')),
+    '#options' => $calendar->week_days(TRUE),
   );
 
   $form['timezone'] = array(
@@ -1930,10 +1948,23 @@ function system_regional_settings() {
     '#description' => t('Only applied if users may set their own time zone.')
   );
 
+  $form['#submit'][] = 'system_calendar_settings_submit';
+
   return system_settings_form($form);
 }
 
 /**
+ * Form submission handler for system_calendar_settings().
+ *
+ * @ingroup forms
+ */
+function system_calendar_settings_submit($form, &$form_state) {
+  $config = config('system.calendar');
+  $config->set('calendar', $form_state['values']['calendar']);
+  $config->save();
+}
+
+/**
  * Form builder; Configure the site date and time settings.
  *
  * @ingroup forms
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index a9a2e17..32df69f 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -147,6 +147,34 @@ function hook_cron() {
 }
 
 /**
+ * Defines available calendar system information.
+ *
+ * Drupal provides a pluggable system for defining the calendar
+ * system used when displaying dates and date parts. Modules that provide
+ * information about calendar systems other than Gregorian can
+ * implement this hook and identify the calendar system being added
+ * and the values for days, weeks, and months in that system.
+ *
+ * @return array
+ *   An associative array where the key is the calendar name and the value is
+ *   again an associative array. Supported keys are:
+ *   - label: The human readable label of the calendar system.
+ *   - class: The associated calendar class. Must implement
+ *     \Drupal\Core\Datetime\Plugin\DateCalendarInterface.
+ *
+ * @see system_calendar()
+ * @see \Drupal\Date\Datetime\Plugin\Type\Gregorian
+ */
+function hook_date_calendar_info() {
+  return array(
+    'gregorian' => array(
+      'label' => t('Gregorian'),
+      'class' => '\Drupal\Core\Datetime\Plugin\Type\Gregorian',
+    ),
+  );
+}
+
+/**
  * Defines available data types for the typed data API.
  *
  * The typed data API allows modules to support any kind of data based upon
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index ea3dadc..29f404b 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -7,7 +7,6 @@
 
 use Drupal\Core\Utility\ModuleInfo;
 use Drupal\Core\TypedData\Primitive;
-
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Response;
 
@@ -1995,6 +1994,42 @@ function system_stream_wrappers() {
 }
 
 /**
+ * Implements hook_date_calendar_info().
+ */
+function system_date_calendar_info() {
+  return array(
+    'gregorian' => array(
+      'label' => t('Gregorian'),
+      'class' => '\Drupal\Core\Datetime\Plugin\Type\Gregorian',
+    ),
+  );
+}
+
+/**
+* Get system calendar information and store for future use.
+*/
+function system_calendar($calendar = NULL) {
+  // Use the advanced drupal_static() pattern, since this could
+  // be called very often.
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast)) {
+    $drupal_static_fast['calendars'] = &drupal_static(__FUNCTION__);
+  }
+  $calendars = &$drupal_static_fast['calendars'];
+
+  if (!isset($calendar)) {
+    $calendar = config('system.calendar')->get('calendar');
+  }
+  // Store Calendar objects in an array rather than repeatedly
+  // constructing identical objects over the life of a request.
+  if (!isset($calendars[$calendar])) {
+    $plugin = new \Drupal\Core\Datetime\Plugin\DateCalendar();
+    $calendars[$calendar] = $plugin->createInstance($calendar);
+  }
+  return $calendars[$calendar];
+}
+
+/**
  * Implements hook_data_type_info().
  */
 function system_data_type_info() {
@@ -3539,7 +3574,7 @@ function system_time_zones($blank = NULL) {
     // 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)));
-    }
+     }
   }
   // Sort the translated time zones alphabetically.
   asort($zones);
diff --git a/core/modules/system/tests/modules/datetime_test/datetime_test.info b/core/modules/system/tests/modules/datetime_test/datetime_test.info
new file mode 100644
index 0000000..127781f
--- /dev/null
+++ b/core/modules/system/tests/modules/datetime_test/datetime_test.info
@@ -0,0 +1,6 @@
+name = "Datetime Test"
+description = "Support module for Datetime tests."
+core = 8.x
+package = Testing
+version = VERSION
+hidden = TRUE
diff --git a/core/modules/system/tests/modules/datetime_test/datetime_test.module b/core/modules/system/tests/modules/datetime_test/datetime_test.module
new file mode 100644
index 0000000..77f564b
--- /dev/null
+++ b/core/modules/system/tests/modules/datetime_test/datetime_test.module
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @file
+ * Test module for Datetime functionality.
+ */
+
+/**
+ * Implements hook_date_calendar_info().
+ */
+function datetime_test_date_calendar_info() {
+  return array(
+    'gamma' => array(
+      'label' => t('Gamma'),
+      'class' => '\Drupal\datetime_test\Gamma',
+    ),
+  );
+}
+
diff --git a/core/modules/system/tests/modules/datetime_test/lib/Drupal/datetime_test/Gamma.php b/core/modules/system/tests/modules/datetime_test/lib/Drupal/datetime_test/Gamma.php
new file mode 100644
index 0000000..b817d3e
--- /dev/null
+++ b/core/modules/system/tests/modules/datetime_test/lib/Drupal/datetime_test/Gamma.php
@@ -0,0 +1,284 @@
+<?php
+/**
+ * @file
+ * Definition of Drupal\datetime_test\Gamma.
+ *
+ * Lots of helpful functions for use in massaging dates,
+ * specific the the calendar system in use. The values include
+ * both translated and untranslated values.
+ *
+ * Untranslated values are useful as array keys and as css
+ * identifiers, and should be listed in English.
+ *
+ * Translated values are useful for display to the user. All
+ * values that need translation should be hard-coded so the translation
+ * system will be able to process them.
+ */
+namespace Drupal\datetime_test;
+
+use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Datetime\Plugin\DateCalendarInterface;
+
+/**
+ * Defines a Gamma Calendar implementation.
+ */
+class Gamma implements DateCalendarInterface {
+
+  /**
+   * Constructs an untranslated array of month names.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names_untranslated() {}
+
+  /**
+   * Constructs an untranslated array of abbreviated month names.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names_abbr_untranslated() {}
+
+  /**
+   * Constructs an untranslated array of week days.
+   *
+   * @return array
+   *   An array of week day names
+   */
+  public static function week_days_untranslated() {}
+
+  /**
+   * Returns a translated array of month names.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of month names.
+   */
+  public static function month_names($required = FALSE) {
+    // Force the key to use the correct month value, rather than
+    // starting with zero.
+    return array(
+            1  => 'Alpha',
+            2  => 'Beta',
+            3  => 'Gamma',
+            4  => 'Delta',
+    );
+  }
+
+  /**
+   * Constructs a translated array of month name abbreviations
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of month abbreviations.
+   */
+  public static function month_names_abbr($required = FALSE) {}
+
+  /**
+   * Returns a translated array of week names.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day names
+   */
+  public static function week_days($required = FALSE) {}
+
+  /**
+   * Constructs a translated array of week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day abbreviations
+   */
+  public static function week_days_abbr($required = FALSE) {}
+
+  /**
+   * Constructs a translated array of 2-letter week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day 2 letter abbreviations
+   */
+  public static function week_days_abbr2($required = FALSE) {}
+
+  /**
+   * Constructs a translated array of 1-letter week day abbreviations.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of week day 1 letter abbreviations
+   */
+  public static function week_days_abbr1($required = FALSE) {}
+
+  /**
+   * Reorders weekdays to match the first day of the week.
+   *
+   * @param array $weekdays
+   *   An array of weekdays.
+   *
+   * @return array
+   *   An array of weekdays reordered to match the first day of the week.
+   */
+  public static function week_days_ordered($weekdays) {}
+
+  /**
+   * Constructs an array of years in a specified range.
+   *
+   * @param int $min
+   *   The minimum year in the array.
+   * @param int $max
+   *   The maximum year in the array.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of years in the selected range.
+   */
+  public static function years($min = 0, $max = 0, $required = FALSE) {}
+
+  /**
+   * Constructs an array of days in a month.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $month
+   *   (optional) The month in which to find the number of days.
+   * @param int $year
+   *   (optional) The year in which to find the number of days.
+   *
+   * @return array
+   *   An array of days for the selected month.
+   */
+  public static function days($required = FALSE, $month = NULL, $year = NULL) {}
+
+  /**
+   * Constructs an array of hours.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the hours.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of hours in the selected format.
+   */
+  public static function hours($format = 'H', $required = FALSE) {}
+
+  /**
+   * Constructs an array of minutes.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the minutes.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $increment
+   *   A the integer value to increment the values. Defaults to 1.
+   *
+   * @return array
+   *   An array of minutes in the selected format.
+   */
+  public static function minutes($format = 'i', $required = FALSE, $increment = 1) {}
+
+  /**
+   * Constructs an array of seconds.
+   *
+   * @param string $format
+   *   A date format string that indicates the format to use for the seconds.
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   * @param int $increment
+   *   A the integer value to increment the values. Defaults to 1.
+   *
+   * @return array
+   *   An array of seconds in the selected format.
+   */
+  public static function seconds($format = 's', $required = FALSE, $increment = 1) {}
+
+  /**
+   * Constructs an array of AM and PM options.
+   *
+   * @param bool $required
+   *   (optional) If FALSE, the returned array will include a blank value.
+   *   Defaults to FALSE.
+   *
+   * @return array
+   *   An array of AM and PM options.
+   */
+  public static function ampm($required = FALSE) {}
+
+  /**
+   * Identifies the number of days in a month for a date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return integer
+   *   The number of days in the month.
+   */
+  public static function days_in_month($date = NULL) {}
+
+  /**
+   * Identifies the number of days in a year for a date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return integer
+   *   The number of days in the year.
+   */
+  public static function days_in_year($date = NULL) {}
+
+  /**
+   * Returns day of week for a given date (0 = Sunday).
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   *
+   * @return int
+   *   The number of the day in the week.
+   */
+  public static function day_of_week($date = NULL) {}
+
+  /**
+   * Returns translated name of the day of week for a given date.
+   *
+   * @param mixed $date
+   *   (optional) A date object, timestamp, or a date string.
+   *   Defaults to current date.
+   * @param string $abbr
+   *   (optional) Whether to return the abbreviated name for that day.
+   *   Defaults to TRUE.
+   *
+   * @return string
+   *   The name of the day in the week for that date.
+   */
+  public static function day_of_week_name($date = NULL, $abbr = TRUE) {}
+
+}
