Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Component / Datetime / DateTimePlus.php
index 11611686728ba198e1c82cd16e4ff6891ea37bd6..bb56ba545d071258e562de9a2355228469335177 100644 (file)
@@ -41,12 +41,12 @@ class DateTimePlus {
 
   use ToStringTrait;
 
-  const FORMAT   = 'Y-m-d H:i:s';
+  const FORMAT = 'Y-m-d H:i:s';
 
   /**
    * A RFC7231 Compliant date.
    *
-   * http://tools.ietf.org/html/rfc7231#section-7.1.1.1
+   * @see http://tools.ietf.org/html/rfc7231#section-7.1.1.1
    *
    * Example: Sun, 06 Nov 1994 08:49:37 GMT
    */
@@ -477,7 +477,6 @@ class DateTimePlus {
     return $format;
   }
 
-
   /**
    * Examines getLastErrors() to see what errors to report.
    *
@@ -671,7 +670,7 @@ class DateTimePlus {
    * Formats the date for display.
    *
    * @param string $format
-   *   A format string using either PHP's date().
+   *   Format accepted by date().
    * @param array $settings
    *   - timezone: (optional) String timezone name. Defaults to the timezone
    *     of the date object.
@@ -715,4 +714,14 @@ class DateTimePlus {
     $this->dateTimeObject->setTime(12, 0, 0);
   }
 
+  /**
+   * Gets a clone of the proxied PHP \DateTime object wrapped by this class.
+   *
+   * @return \DateTime
+   *   A clone of the wrapped PHP \DateTime object.
+   */
+  public function getPhpDateTime() {
+    return clone $this->dateTimeObject;
+  }
+
 }