Gender with blood test

Erin
How soon can you figure out the gender with a blood test and how does it work?