src/DateTime.php
public static function create(...$params)
	{
		switch (count($params))
		{
			case 1: //	'2017-01-01'
			case 2:	//	'2017-01-01', $tz
			case 3:	//	$year, $month, $day
			case 4:	//	$year, $month, $day, $tz
			case 5:	//	$year, $month, $day, $hour, $minute							// not useful
			case 6:	//	$year, $month, $day, $hour, $minute, $second
			case 7:	//	$year, $month, $day, $hour, $minute, $second, $timezone
		}

		return new static(new \DateTime($time, $timezone === null ? self::$utc : (is_string($timezone) ? new \DateTimeZone($timezone) : $timezone)));
	}
public static function create(...$params)
	{
		switch (count($params))
		{
			case 1: //	'2017-01-01'
			case 2:	//	'2017-01-01', $tz
			case 3:	//	$year, $month, $day
			case 4:	//	$year, $month, $day, $tz
			case 5:	//	$year, $month, $day, $hour, $minute							// not useful
			case 6:	//	$year, $month, $day, $hour, $minute, $second
			case 7:	//	$year, $month, $day, $hour, $minute, $second, $timezone
		}

		return new static(new \DateTime($time, $timezone === null ? self::$utc : (is_string($timezone) ? new \DateTimeZone($timezone) : $timezone)));
	}
public static function create ( ... $ params ) { switch ( count ( $ params ) ) { case 1 : //	'2017-01-01'
 case 2 : //	'2017-01-01', $tz
 case 3 : //	$year, $month, $day
 case 4 : //	$year, $month, $day, $tz
 case 5 : //	$year, $month, $day, $hour, $minute							// not useful
 case 6 : //	$year, $month, $day, $hour, $minute, $second
 case 7 : //	$year, $month, $day, $hour, $minute, $second, $timezone
 } return new static ( new \ DateTime ( $ time , $ timezone === null ? self :: $ utc : ( is_string ( $ timezone ) ? new \ DateTimeZone ( $ timezone ) : $ timezone ) ) ) ; }
Create a new Twister\DateTime instance from a specific date and time.


If any of $year, $month or $day are set to null their now() values will be used.

If $hour is null it will be set to its now() value and the default
values for $minute and $second will be their now() values.

If $hour is not null then the default values for $minute and $second will be 0.

@link http://php.net/manual/en/datetime.construct.php

@param int|null                  $year
@param int|null                  $month
@param int|null                  $day
@param int|null                  $hour
@param int|null                  $minute
@param int|null                  $second
@param \DateTimeZone|string|null $tz

@return static
Create a new Twister \ DateTime instance from a specific date and time .