Hello!

I've started to use `DateTime64` recently and faced the next issue with `toDate()`/`toDate32()` functions.

This query works fine:
```sql
SELECT toDate('2022-07-26 00:00:00')

Query id: bf64d8a8-018d-4b3e-ae24-f92600a1fa15

┌─toDate('2022-07-26 00:00:00')─┐
│                    2022-07-26 │
└───────────────────────────────┘

1 rows in set. Elapsed: 0.003 sec.
```

But when the string representation of the timestamp has the milliseconds fraction the function does not work:
```sql
SELECT toDate('2022-07-26 00:00:00.000')

Query id: 8b42473a-0ceb-4892-b0e7-6f73f583d4b4


0 rows in set. Elapsed: 0.006 sec.

Received exception from server (version 22.3.8):
Code: 6. DB::Exception: Received from s:9000. DB::Exception: Cannot parse string '2022-07-26 00:00:00.000' as Date: syntax error at position 10 (parsed just '2022-07-26'): While processing toDate('2022-07-26 00:00:00.000'). (CANNOT_PARSE_TEXT)
```

The `toDate32()` doesn't work in both cases.

Yes, you can say I must change the input or use a workaround like this:
```sql
SELECT toDate(toDateTime64('2022-07-26 00:00:00.000', 3, 'UTC')) AS date
```

But it's not convenient and it'd be great if the mentioned functions will ignore the time part.

P.s. ClickHouse server version: `22.3.8.39`

using FunctionToDate = FunctionConvert<DataTypeDate, NameToDate, ToDateMonotonicity>;
using FunctionToDate32 = FunctionConvert<DataTypeDate32, NameToDate32, ToDateMonotonicity>;
using FunctionToDateTime = FunctionConvert<DataTypeDateTime, NameToDateTime, ToDateTimeMonotonicity>;
using FunctionToDateTime32 = FunctionConvert<DataTypeDateTime, NameToDateTime32, ToDateTimeMonotonicity>;
using FunctionToDateTime64 = FunctionConvert<DataTypeDateTime64, NameToDateTime64, UnknownMonotonicity>;
using FunctionToUUID = FunctionConvert<DataTypeUUID, NameToUUID, ToNumberMonotonicity<UInt128>>;
using FunctionToString = FunctionConvert<DataTypeString, NameToString, ToStringMonotonicity>;
using FunctionToUnixTimestamp = FunctionConvert<DataTypeUInt32, NameToUnixTimestamp, ToNumberMonotonicity<UInt32>>;
using FunctionToDecimal32 = FunctionConvert<DataTypeDecimal<Decimal32>, NameToDecimal32, UnknownMonotonicity>;
using FunctionToDecimal64 = FunctionConvert<DataTypeDecimal<Decimal64>, NameToDecimal64, UnknownMonotonicity>;
using FunctionToDecimal128 = FunctionConvert<DataTypeDecimal<Decimal128>, NameToDecimal128, UnknownMonotonicity>;
using FunctionToDecimal256 = FunctionConvert<DataTypeDecimal<Decimal256>, NameToDecimal256, UnknownMonotonicity>;
template <typename DataType> struct FunctionTo;
template <> struct FunctionTo<DataTypeUInt8> { using Type = FunctionToUInt8; };
template <> struct FunctionTo<DataTypeUInt16> { using Type = FunctionToUInt16; };
template <> struct FunctionTo<DataTypeUInt32> { using Type = FunctionToUInt32; };
template <> struct FunctionTo<DataTypeUInt64> { using Type = FunctionToUInt64; };
template <> struct FunctionTo<DataTypeUInt128> { using Type = FunctionToUInt128; };
template <> struct FunctionTo<DataTypeUInt256> { using Type = FunctionToUInt256; };
template <> struct FunctionTo<DataTypeInt8> { using Type = FunctionToInt8; };
template <> struct FunctionTo<DataTypeInt16> { using Type = FunctionToInt16; };
template <> struct FunctionTo<DataTypeInt32> { using Type = FunctionToInt32; };
template <> struct FunctionTo<DataTypeInt64> { using Type = FunctionToInt64; };
template <> struct FunctionTo<DataTypeInt128> { using Type = FunctionToInt128; };
template <> struct FunctionTo<DataTypeInt256> { using Type = FunctionToInt256; };
template <> struct FunctionTo<DataTypeFloat32> { using Type = FunctionToFloat32; };
template <> struct FunctionTo<DataTypeFloat64> { using Type = FunctionToFloat64; };
template <> struct FunctionTo<DataTypeDate> { using Type = FunctionToDate; };
template <> struct FunctionTo<DataTypeDate32> { using Type = FunctionToDate32; };
template <> struct FunctionTo<DataTypeDateTime> { using Type = FunctionToDateTime; };