It is when the bankruptcy trustee conducts a brief hearing, where the client is sworn in, and can then answer questions from either the trustee, or the creditors regarding your petition, which they have received ahead of time. At the end of the hearing in Chapter 7, the trustee approves your petition, and the client receives a discharge of all debt. Under Chapter 13, the trustee will approve your plan of payment.
Don’t worry about your credit rating when you declare bankruptcy. That is the time to cut up your credit cards and start over to rebuild your credit worthiness.