By about a month old, you could wing spot sex them to try determine what it is. It worked for me when I tried it on my three month old cockatiel. I will send you the screenshots I took of them. Depending on the character, you might be able to tell very early, but that isn't always accurate either because sometimes you can have a very docile male, or a very vocal female. Or the best bet is to DNA it, and you can do that at any time. The results usually come back within a week.