public static function createJalali($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null)
    {
        $now = static::instance(null, $timezone)->format('Y-n-j-G-i-s');
        $defaults = array_combine(array('year', 'month', 'day', 'hour', 'minute', 'second'), explode('-', $now));

        $year   = $year   === null ? intval($defaults['year'])   : $year;
        $month  = $month  === null ? intval($defaults['month'])  : $month;
        $day    = $day    === null ? intval($defaults['day'])    : $day;
        $hour   = $hour   === null ? intval($defaults['hour'])   : $hour;
        $minute = $minute === null ? intval($defaults['minute']) : $minute;
        $second = $second === null ? intval($defaults['second']) : $second;

        if (!static::isValideDate($year, $month, $day) || !static::isValideTime($hour, $minute, $second)) {
            throw new \InvalidArgumentException('Unknown datetime');
        }

        return static::parse(sprintf('%s-%s-%s %s:%s:%s', $year, $month, $day, $hour, $minute, $second));
    }
public static function createJalali($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null)
    {
        $now = static::instance(null, $timezone)->format('Y-n-j-G-i-s');
        $defaults = array_combine(array('year', 'month', 'day', 'hour', 'minute', 'second'), explode('-', $now));

        $year   = $year   === null ? intval($defaults['year'])   : $year;
        $month  = $month  === null ? intval($defaults['month'])  : $month;
        $day    = $day    === null ? intval($defaults['day'])    : $day;
        $hour   = $hour   === null ? intval($defaults['hour'])   : $hour;
        $minute = $minute === null ? intval($defaults['minute']) : $minute;
        $second = $second === null ? intval($defaults['second']) : $second;

        if (!static::isValideDate($year, $month, $day) || !static::isValideTime($hour, $minute, $second)) {
            throw new \InvalidArgumentException('Unknown datetime');
        }

        return static::parse(sprintf('%s-%s-%s %s:%s:%s', $year, $month, $day, $hour, $minute, $second));
    }
public static function createJalali ( $ year = null , $ month = null , $ day = null , $ hour = null , $ minute = null , $ second = null , $ timezone = null ) { $ now = static :: instance ( null , $ timezone ) -> format ( 'Y-n-j-G-i-s' ) ; $ defaults = array_combine ( array ( 'year' , 'month' , 'day' , 'hour' , 'minute' , 'second' ) , explode ( '-' , $ now ) ) ; $ year = $ year === null ? intval ( $ defaults [ 'year' ] ) : $ year ; $ month = $ month === null ? intval ( $ defaults [ 'month' ] ) : $ month ; $ day = $ day === null ? intval ( $ defaults [ 'day' ] ) : $ day ; $ hour = $ hour === null ? intval ( $ defaults [ 'hour' ] ) : $ hour ; $ minute = $ minute === null ? intval ( $ defaults [ 'minute' ] ) : $ minute ; $ second = $ second === null ? intval ( $ defaults [ 'second' ] ) : $ second ; if ( ! static :: isValideDate ( $ year , $ month , $ day ) || ! static :: isValideTime ( $ hour , $ minute , $ second ) ) { throw new \ InvalidArgumentException ( 'Unknown datetime' ) ; } return static :: parse ( sprintf ( '%s-%s-%s %s:%s:%s' , $ year , $ month , $ day , $ hour , $ minute , $ second ) ) ; }
Create a new Verta instance from a specific date and time.

If any of feild are set to null their now() values will
be used.

@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 $timezone

@return static
Create a new Verta instance from a specific date and time .