public DrupalDateTime::__construct($time = 'now', $timezone = NULL, $settings = array())
Constructs a date object.
string $time: A date/input_time_adjusted string. Defaults to 'now'.
mixed $timezone: PHP DateTimeZone object, string or NULL allowed. Defaults to NULL.
array $settings:
Overrides DateTimePlus::__construct
public function __construct($time = 'now', $timezone = NULL, $settings = array()) { if (!isset($settings['langcode'])) { $settings['langcode'] = \Drupal::languageManager()->getCurrentLanguage()->getId(); } // Instantiate the parent class. parent::__construct($time, $timezone, $settings); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Datetime!DrupalDateTime.php/function/DrupalDateTime::__construct/8.1.x