diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
index fb52a80..10b5828 100644
--- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
@@ -26,7 +26,7 @@
  * to abort processing. The calling script can decide what to do about
  * errors using hasErrors() and getErrors().
  */
-class DateTimePlus extends \DateTime {
+class DateTimePlus extends DateTimePlusDummy {
 
   const FORMAT   = 'Y-m-d H:i:s';
 
@@ -160,65 +160,6 @@ public static function createFromTimestamp($timestamp, $timezone = NULL, $settin
   }
 
   /**
-   * Creates a date object from an input format.
-   *
-   * @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.
-   *   @see http://us3.php.net/manual/en/datetime.createfromformat.php
-   * @param mixed $time
-   *   @see __construct()
-   * @param mixed $timezone
-   *   @see __construct()
-   * @param array $settings
-   *   - validate_format: (optional) Boolean choice to validate the
-   *     created date using the input format. The format used in
-   *     createFromFormat() allows slightly different values than format().
-   *     Using an input format that works in both functions makes it
-   *     possible to a validation step to confirm that the date created
-   *     from a format string exactly matches the input. This option
-   *     indicates the format can be used for validation. Defaults to TRUE.
-   *   @see __construct()
-   */
-  public static function createFromFormat($format, $time, $timezone = NULL, $settings = array()) {
-    if (!isset($settings['validate_format'])) {
-      $settings['validate_format'] = TRUE;
-    }
-
-    // Tries 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.
-    $datetimeplus = new static('', $timezone, $settings);
-
-    $date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone());
-    if (!$date instanceOf \DateTime) {
-      throw new \Exception('The date cannot be created from a format.');
-    }
-    else {
-      // Functions that parse date is forgiving, it might create a date that
-      // is not exactly a match for the provided value, so test for that by
-      // re-creating the date/time formatted string and comparing it to the input. For
-      // instance, an input value of '11' using a format of Y (4 digits) gets
-      // created as '0011' instead of '2011'.
-      if ($date instanceOf DateTimePlus) {
-        $test_time = $date->format($format, $settings);
-      }
-      elseif ($date instanceOf \DateTime) {
-        $test_time = $date->format($format);
-      }
-      $datetimeplus->setTimestamp($date->getTimestamp());
-      $datetimeplus->setTimezone($date->getTimezone());
-
-      if ($settings['validate_format'] && $test_time != $time) {
-        throw new \Exception('The created date does not match the input value.');
-      }
-    }
-    return $datetimeplus;
-  }
-
-  /**
    * Constructs a date object set to a requested date and timezone.
    *
    * @param string $time
diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlusDummy.php b/core/lib/Drupal/Component/Datetime/DateTimePlusDummy.php
new file mode 100644
index 0000000..929fc88
--- /dev/null
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlusDummy.php
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Component\Datetime\DateTimePlusDummy
+ */
+namespace Drupal\Component\Datetime;
+
+if (version_compare(PHP_VERSION, '7.0-dev', '>=')) {
+
+  /**
+   * Helper class for DateTimePlus, only intended to define DateTimePlus::createFromFormat().
+   *
+   * We define this class once for PHP7 and up and once for PHP5, as both
+   * versions have different definitions for DateTime::createFromFormat().
+   */
+  class DateTimePlusDummy extends \DateTime {
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function createFromFormat($format, $time, \DateTimeZone $timezone = NULL, $settings = array()) {
+      if (!isset($settings['validate_format'])) {
+        $settings['validate_format'] = TRUE;
+      }
+
+      // Tries 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.
+      $datetimeplus = new static('', $timezone, $settings);
+
+      $date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone());
+      if (!$date instanceOf \DateTime) {
+        throw new \Exception('The date cannot be created from a format.');
+      }
+      else {
+        // Functions that parse date is forgiving, it might create a date that
+        // is not exactly a match for the provided value, so test for that by
+        // re-creating the date/time formatted string and comparing it to the input. For
+        // instance, an input value of '11' using a format of Y (4 digits) gets
+        // created as '0011' instead of '2011'.
+        if ($date instanceOf DateTimePlus) {
+          $test_time = $date->format($format, $settings);
+        }
+        elseif ($date instanceOf \DateTime) {
+          $test_time = $date->format($format);
+        }
+        $datetimeplus->setTimestamp($date->getTimestamp());
+        $datetimeplus->setTimezone($date->getTimezone());
+
+        if ($settings['validate_format'] && $test_time != $time) {
+          throw new \Exception('The created date does not match the input value.');
+        }
+      }
+      return $datetimeplus;
+    }
+  }
+}
+else {
+
+  /**
+   * Helper class for DateTimePlus, only intended to define DateTimePlus::createFromFormat().
+   *
+   * We define this class once for PHP7 and up, and once for PHP5, as PHP7 needs
+   * a type hint for the timezone parameter and PHP5 does not.
+   */
+  class DateTimePlusDummy extends \DateTime {
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function createFromFormat($format, $time, $timezone = NULL, $settings = array()) {
+      if (!isset($settings['validate_format'])) {
+        $settings['validate_format'] = TRUE;
+      }
+
+      // Tries 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.
+      $datetimeplus = new static('', $timezone, $settings);
+
+      $date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone());
+      if (!$date instanceOf \DateTime) {
+        throw new \Exception('The date cannot be created from a format.');
+      }
+      else {
+        // Functions that parse date is forgiving, it might create a date that
+        // is not exactly a match for the provided value, so test for that by
+        // re-creating the date/time formatted string and comparing it to the input. For
+        // instance, an input value of '11' using a format of Y (4 digits) gets
+        // created as '0011' instead of '2011'.
+        if ($date instanceOf DateTimePlus) {
+          $test_time = $date->format($format, $settings);
+        }
+        elseif ($date instanceOf \DateTime) {
+          $test_time = $date->format($format);
+        }
+        $datetimeplus->setTimestamp($date->getTimestamp());
+        $datetimeplus->setTimezone($date->getTimezone());
+
+        if ($settings['validate_format'] && $test_time != $time) {
+          throw new \Exception('The created date does not match the input value.');
+        }
+      }
+      return $datetimeplus;
+    }
+  }
+}
