How does a duck change its sex?

Last year, I was surprised to find my female mandarin duck was turning into a male. Even as a zoology graduate and someone who has kept birds in an aviary since I was 10 years old, I had absolutely no idea this could happen, so I started investigating, and it turns out that the way birds express their sex is a fiendishly complex affair.

Source: How does a duck change its sex? – BBC News