`formatDateTime(..., '%C')` returns wrong value when date is outwith normal range
```
SELECT formatDateTime(toDateTime64('1935-12-12 12:12:12', 0, 'Europe/Moscow'), '%C')

┌─formatDateTime(toDateTime64('1935-12-12 12:12:12', 0, 'Europe/Moscow'), '%C')─┐
│ 20                                                                            │
└───────────────────────────────────────────────────────────────────────────────┘


SELECT formatDateTime(toDateTime64('1969-12-12 12:12:12', 0, 'Europe/Moscow'), '%C')

┌─formatDateTime(toDateTime64('1969-12-12 12:12:12', 0, 'Europe/Moscow'), '%C')─┐
│ 21                                                                            │
└───────────────────────────────────────────────────────────────────────────────┘

SELECT formatDateTime(toDateTime64('2200-12-12 12:12:12', 0, 'Europe/Moscow'), '%C')

┌─formatDateTime(toDateTime64('2200-12-12 12:12:12', 0, 'Europe/Moscow'), '%C')─┐
│ 20                                                                            │
└───────────────────────────────────────────────────────────────────────────────┘


```

ClickHouse version 21.5.1.6463 (official build).
String getName() const override
    {
        return name;
    }
    bool useDefaultImplementationForConstants() const override { return true; }
    ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1, 2}; }
    bool isVariadic() const override { return true; }
    size_t getNumberOfArguments() const override { return 0; }
    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override
    {
        if constexpr (support_integer)
        {
            if (arguments.size() != 1 && arguments.size() != 2 && arguments.size() != 3)
                throw Exception(
                    "Number of arguments for function " + getName() + " doesn't match: passed " + toString(arguments.size())
                        + ", should be 1, 2 or 3",
                    ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
            if (arguments.size() == 1 && !isInteger(arguments[0].type))
                throw Exception(
                    "Illegal type " + arguments[0].type->getName() + " of 1 argument of function " + getName()
                        + " when arguments size is 1. Should be integer",
                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
            if (arguments.size() > 1 && !(isInteger(arguments[0].type) || WhichDataType(arguments[0].type).isDateOrDateTime()))
                throw Exception(