I have read that you can know the gender of your baby between the 12th and 16th week. But due to the babies position it could take longer. I am not a doctor but i have read that info and thought i would share.
They normally won't tell you until 18 weeks. You can have an elective ultrasound paid for our of picked at 16 weeks but most drs won't confirm until 18. You can have blood work done after 10 weeks and that's just as accurate as ultrasound if not more.
Most doctors won't due it until week 20 but you cansee the gender from 16-20 weeks... 12 weeks no way the baby's junk is hardly developed.
About 18-21 weeks is around the time you should have the anatomy ultrasound, and that's when they will usually let you know the sex of baby if baby is showing it off :) sometimes they don't have their legs open or the umbilical chord could be in the way, like it was when I had my scan.