DateTimePlus::createFromDateTime

public static DateTimePlus::createFromDateTime(\DateTime $datetime, $settings = array())

Creates a date object from an input date object.

Parameters

\DateTime $datetime: A DateTime object.

array $settings: @see __construct()

Return value

static A new DateTimePlus object.

File

core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 111

Class

DateTimePlus
Wraps DateTime().

Namespace

Drupal\Component\Datetime

Code

public static function createFromDateTime(\DateTime $datetime, $settings = array()) {
  return new static($datetime->format(static::FORMAT), $datetime->getTimezone(), $settings);
}
doc_Drupal
2016-10-29 09:01:02
Comments
Leave a Comment

Please login to continue.