Actually, the fruit gender offset can work at any time during the pregnancy. By default, the chance for each gender is 50%. Eating the right fruit offsets the chance by 10%. You only need to eat 5 fruit to have a 100% chance to get a certain gender, and the gender offset cannot exceed 100%. This is in the Pregnancy XML in the GameplayData.package.
More interesting facts from the Pregnancy XML: default chance of Twins is 2.5%, default chance of triplets is 0.1%. Each pregnancy book read adds a bonus of 15 to the Pregnancy Average Mood, which is used to decide whether you get to pick the traits of baby.
Anyhow, If you're using NRaas StoryProgresison, the following is set by default:
Newborn Gender- Specifies what gender the first child of a pregnancy will be. The second or third gender will be random.
- Choosing "Balanced" will attempt to maintain an equal number of males and females in the town
- Default: Balanced
I have found with this setting I almost always get the opposite gender of the fruit I eat.