public function toMySQLDate($withTime = true)
    {
        if ($this->isHollow()) {
            return $withTime ? '0000-00-00 00:00:00' : '0000-00-00';
        }

        $format = $withTime ? 'Y-m-d H:i:s' : 'Y-m-d';

        return $this->format($format);
    }
public function toMySQLDate($withTime = true)
    {
        if ($this->isHollow()) {
            return $withTime ? '0000-00-00 00:00:00' : '0000-00-00';
        }

        $format = $withTime ? 'Y-m-d H:i:s' : 'Y-m-d';

        return $this->format($format);
    }
public function toMySQLDate ( $ withTime = true ) { if ( $ this -> isHollow ( ) ) { return $ withTime ? '0000-00-00 00:00:00' : '0000-00-00' ; } $ format = $ withTime ? 'Y-m-d H:i:s' : 'Y-m-d' ; return $ this -> format ( $ format ) ; }
Returns date in MySQL format.

NOTE: It returns 0000-00-00 00:00:00 for hollow dates

@param bool $withTime

@return string
Returns date in MySQL format .