Joseph also went up from Galilee, out of the city of Nazareth, into Judea, to the city of David, which is called Bethlehem, because he was of the house and family of David;
Most readers assume that the couple arrived in Bethlehem just before Jesus’ birth. However the text does not require nor rule out this reading. They may have been there for some time before Mary went into labor.