
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
}
                                else
                                    throw Exception("Unexpected inf or nan to integer conversion", ErrorCodes::CANNOT_CONVERT_TYPE);
                            }
                        }
                        if constexpr (std::is_same_v<Additions, AccurateOrNullConvertStrategyAdditions>
                                || std::is_same_v<Additions, AccurateConvertStrategyAdditions>)
                        {
                            bool convert_result = accurate::convertNumeric(vec_from[i], vec_to[i]);
                            if (!convert_result)
                            {
                                if (std::is_same_v<Additions, AccurateOrNullConvertStrategyAdditions>)
                                {
                                    vec_to[i] = 0;
                                    (*vec_null_map_to)[i] = true;
                                }
                                else
                                {
                                    throw Exception(
                                        "Value in column " + named_from.column->getName() + " cannot be safely converted into type "
                                            + result_type->getName(),
                                        ErrorCodes::CANNOT_CONVERT_TYPE);
                                }
                            }
                        }
                        else
                        {
                            vec_to[i] = static_cast<ToFieldType>(vec_from[i]);
                        }
                    }