```
SELECT toStartOfDay(yesterday())


Received exception from server (version 20.10.1):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Function toStartOfDay supports a 2nd argument (optional) that must be non-empty and be a valid time zone.


SELECT toStartOfDay(today())


Received exception from server (version 20.10.1):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Function toStartOfDay supports a 2nd argument (optional) that must be non-empty and be a valid time zone.

```
because of https://github.com/ClickHouse/ClickHouse/pull/14509
"The timezone argument of function " + getName() + " is allowed only when the 1st argument has the type DateTime",
                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        }
        else
            throw Exception(
                "Number of arguments for function " + getName() + " doesn't match: passed " + toString(arguments.size())
                    + ", should be 1 or 2",
                ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
        
        
        if constexpr (std::is_same_v<ToDataType, DataTypeDateTime>)
        {
            std::string time_zone = extractTimeZoneNameFromFunctionArguments(arguments, 1, 0);
            if (time_zone.empty())
                throw Exception(
                    "Function " + getName() + " supports a 2nd argument (optional) that must be non-empty and be a valid time zone",
                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
            return std::make_shared<ToDataType>(time_zone);
        }
        if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
        {
            Int64 scale = DataTypeDateTime64::default_scale;
            if (const auto * dt64 =  checkAndGetDataType<DataTypeDateTime64>(arguments[0].type.get()))
                scale = dt64->getScale();
            return std::make_shared<ToDataType>(scale, extractTimeZoneNameFromFunctionArguments(arguments, 1, 0));
        }
        else
            return std::make_shared<ToDataType>();
    }
    bool useDefaultImplementationForConstants() const override { return true; }