By the time a woman is considered six weeks pregnant, she would have had two weeks, at most, to realize it.

That’s because the gestational age of a fetus is counted not from the moment that sperm fertilizes an egg or from the moment you have a positive pregnancy test, but weeks earlier, on the first day of the previous menstrual cycle. This means that just two weeks after a missed period, a woman is six weeks pregnant, said Dr. Dawnette Lewis, director of Northwell Health’s Center for Maternal Health in New York and a maternal fetal medicine specialist.

That’s if someone has a typical menstrual cycle, which lasts about four weeks. But several factors — including stress, perimenopause and certain health conditions — can make the menstrual cycle so unpredictable that it could take longer than six weeks for someone to realize they might be pregnant.

“People come in and they’re like, ‘I’ve always had irregular periods and I just thought I was gaining weight’ and lo and behold, they are pregnant,” said Dr. Shruthi Mahalingaiah, a fertility doctor at Massachusetts General Hospital and professor of environmental and reproductive health at Harvard T.H. Chan School of Public Health.

The question of how soon it’s possible to detect and confirm a pregnancy has come into focus as new abortion restrictions have been enacted in 21 states, including in Florida, where a ban on abortion after six weeks is set to take effect May 1, making it the third state to do so.

We asked experts to explain how the first six weeks of pregnancy unfold, and what factors might make a pregnancy hard to detect.