It takes at least six months for the divorce to become final. The six months is counted from the date that the partner who started the divorce had the other served with the Petition for Dissolution and the Summons OR when the other spouse responded (filed their first paper), whichever is earlier. A divorce is not final until a Judgment of Dissolution is signed by the judge.

What if i could not serve the restraining order in time for the court hearing?
You should come to the court hearing and tell the