Welcome to Healthcare Magic
Sex of baby can be confirmed early by Karyotyping earliest. It may be illegal in some countries though. Better to ask your Doctor about CVS Test which is done early in Pregnancy
which may help. Ultrasound
in 18th week will tell sex of baby as well. Kindly discuss the various methods to find sex of baby which conforms with the local rules and regulations.