According to the California Courts website, the process of getting emergency custody can take anywhere from a few days to a few weeks. The first step is to file a petition with the court, which must be done in person. Once the petition is filed, a hearing will be scheduled within 2-3 days. At the hearing, both sides will present their evidence and argument as to why emergency custody should or should not be granted. The judge will then make a decision based on what he or she believes is in the best interests of the child.