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); }
Please login to continue.