You can write the equations of motion as
h(t) = -16t² + v₀sin(θ)t
d(t) = v₀cos(θ)t
Solving the second of these for t and substituting into the first equation gives the time of flight as
0 = -16t² + d(t)·tan(θ)
t = √(d(t)·tan(θ)/16)
So, for d(t) = 400 and θ = π/6, this becomes
t = √((400/16)/√3)
t = 5/√(√3) ≈ 3.79918
The ball is in the air about 3.80 seconds.