X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Flib%2FDrupal%2FComponent%2FDatetime%2FDateTimePlus.php;fp=web%2Fcore%2Flib%2FDrupal%2FComponent%2FDatetime%2FDateTimePlus.php;h=11611686728ba198e1c82cd16e4ff6891ea37bd6;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=711eb4c9d13ee6b248c8a288318502679c8c8168;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/web/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/web/core/lib/Drupal/Component/Datetime/DateTimePlus.php index 711eb4c9d..116116867 100644 --- a/web/core/lib/Drupal/Component/Datetime/DateTimePlus.php +++ b/web/core/lib/Drupal/Component/Datetime/DateTimePlus.php @@ -280,7 +280,7 @@ class DateTimePlus { * parameter and the current timezone are ignored when the $time parameter * either is a UNIX timestamp (e.g. @946684800) or specifies a timezone * (e.g. 2010-01-28T15:00:00+02:00). - * @see http://php.net/manual/en/datetime.construct.php + * @see http://php.net/manual/datetime.construct.php * @param array $settings * (optional) Keyed array of settings. Defaults to empty array. * - langcode: (optional) String two letter language code used to control @@ -704,4 +704,15 @@ class DateTimePlus { return $value; } + /** + * Sets the default time for an object built from date-only data. + * + * The default time for a date without time can be anything, so long as it is + * consistently applied. If we use noon, dates in most timezones will have the + * same value for in both the local timezone and UTC. + */ + public function setDefaultDateTime() { + $this->dateTimeObject->setTime(12, 0, 0); + } + }