Probably only weeks or months, until Herod died in around 1-4 BC. All such dates are approximate.
Going from Nazareth to Egypt was not too hard (there were several trading highways which were ancient at that time). And there was a Hebrew community in Egypt. At the time, Egypt was under Roman rule too, but not Herod.
Why it supposedly took Moses 40 years in his time is confusing to me. There were good roads with wells and rest stops. No Starbucks. But, ok, I know how the Old Testament discusses that. It was not for lack of GPS.
Thinking about that not just about Christmastime, but because Mrs. BD are traveling to Egypt in a week or so. Cairo, cruise up the Nile to Aswan, etc. My hope is to see some hippos and crocogators. Daytime temps around 70 F.
I've read that in ancient times noble Egyptians had domesticated crocs as garden pets, and decorated them with jewels. Nobody has/had a hippo as a pet. Not friendly monsters.
Unlike Saudi, you can buy beer in Egypt. The Saudis go to Dubai, London, Paris, and NYC to party. And Milan for special shopping.
Some drug lord moron accidentally introduced Hippos to South America, where they thrive.