
select toDateTime64(-86400 ,9,'UTC') ==  1969-12-31 00:00:00.000000000

select toDateTime64(-86400.00 ,9,'UTC') ==  1970-01-01 00:00:00.000000000 


However, I expect both outputs to be same. 

Version affected : 22.8
{
        if (arguments.empty())
            throw Exception{"Function " + getName() + " expects at least 1 argument",
               ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
        if (result_type->onlyNull())
            return result_type->createColumnConstWithDefaultValue(input_rows_count);
        const DataTypePtr from_type = removeNullable(arguments[0].type);
        ColumnPtr result_column;
        auto call = [&](const auto & types, const auto & tag) -> bool
        {
            using Types = std::decay_t<decltype(types)>;
            using LeftDataType = typename Types::LeftType;
            using RightDataType = typename Types::RightType;
            using SpecialTag = std::decay_t<decltype(tag)>;
            if constexpr (IsDataTypeDecimal<RightDataType>)
            {
                if constexpr (std::is_same_v<RightDataType, DataTypeDateTime64>)
                {
                    
                    if (arguments.size() != 2 && arguments.size() != 3)
                        throw Exception{"Function " + getName() + " expects 2 or 3 arguments for DateTime64.",
                            ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
                }
                else if (arguments.size() != 2)
                {
                    throw Exception{"Function " + getName() + " expects 2 arguments for Decimal.",
                        ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
                }
                const ColumnWithTypeAndName & scale_column = arguments[1];