
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 (checkAndGetDataType<DataTypeString>(from_type_untyped.get()))
        {
            return &ConvertImplGenericFromString<ColumnString>::execute;
        }
        const auto * from_type = checkAndGetDataType<DataTypeArray>(from_type_untyped.get());
        const auto * from_type_map = checkAndGetDataType<DataTypeMap>(from_type_untyped.get());
        
        if (from_type_map)
            from_type = checkAndGetDataType<DataTypeArray>(from_type_map->getNestedType().get());
        if (!from_type)
        {
            throw Exception(ErrorCodes::TYPE_MISMATCH,
                "CAST AS Array can only be performed between same-dimensional Array, Map or String types");
        }
        DataTypePtr from_nested_type = from_type->getNestedType();
        
        bool from_empty_array = isNothing(from_nested_type);
        if (from_type->getNumberOfDimensions() != to_type.getNumberOfDimensions() && !from_empty_array)
            throw Exception(ErrorCodes::TYPE_MISMATCH,
                "CAST AS Array can only be performed between same-dimensional array types");
        const DataTypePtr & to_nested_type = to_type.getNestedType();