function DateTimePlus::setDefaultDateTime
Same name in other branches
- 9 core/lib/Drupal/Component/Datetime/DateTimePlus.php \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime()
- 10 core/lib/Drupal/Component/Datetime/DateTimePlus.php \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime()
- 11.x core/lib/Drupal/Component/Datetime/DateTimePlus.php \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime()
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.
File
-
core/
lib/ Drupal/ Component/ Datetime/ DateTimePlus.php, line 718
Class
- DateTimePlus
- Wraps DateTime().
Namespace
Drupal\Component\DatetimeCode
public function setDefaultDateTime() {
$this->dateTimeObject
->setTime(12, 0, 0);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.