What is the earliest a baby can survive if born prematurely?

24 weeks is when a baby is viable.
however they'll be in NICU for a while.