public function setDate($date, $format = DATE_FORMAT_ISO)
    {
        if ($date instanceof AnDate) {
            $this->copy($date);
        } elseif (is_array($date) || $date instanceof AnConfig) {
            foreach ($date as $key => $value) {
                $this->$key = $value;
            }
        } else {
            parent::setDate($date, $format);
        }

        return $this;
    }
public function setDate($date, $format = DATE_FORMAT_ISO)
    {
        if ($date instanceof AnDate) {
            $this->copy($date);
        } elseif (is_array($date) || $date instanceof AnConfig) {
            foreach ($date as $key => $value) {
                $this->$key = $value;
            }
        } else {
            parent::setDate($date, $format);
        }

        return $this;
    }
public function setDate ( $ date , $ format = DATE_FORMAT_ISO ) { if ( $ date instanceof AnDate ) { $ this -> copy ( $ date ) ; } elseif ( is_array ( $ date ) || $ date instanceof AnConfig ) { foreach ( $ date as $ key => $ value ) { $ this -> $ key = $ value ; } } else { parent :: setDate ( $ date , $ format ) ; } return $ this ; }
Sets the Date's internal date.

@param $mixed date
@param $format Object[optional]
Sets the Date s internal date .