How and when did you find out the sex of your baby? At birth? Anatomy scan around 20 weeks? Earlier prenatal testing? Elective scan at some point?

We were team green with our first and it was great finding it after she was born! I've heard now that lots of people do testing at 12 weeks and can find out the sex really early that way. Curious when and how others found out or will find out!