The Court of Appeal holds that defendant was not entitled to presentence custody credits under PC 2900.5 for time spent in a residential treatment program where he voluntarily entered the program and his stay there was not attributable to the proceedings relating to his conviction.