After Proposition 47 resentencing, a defendant’s excess custody credits may be applied to reduce eligible fines, including restitution fines in cases where the crime occurred before 2014. In 2013, Morris pleaded no contest to felony petty theft with priors (Pen. Code, § 666, subd. (a)) and admitted he had a prior strike and two prison priors. The court sentenced him to four years and imposed various fines and fees, including a $280 restitution fine (Pen. Code, § 1202.4, subd. (b)(2)). After Proposition 47 passed, Morris filed a petition to reduce his conviction to a misdemeanor. The court granted it and resentenced Morris to six months in jail, lowered the restitution fine to $200, and waived all of the other fines, fees, and assessments. Morris appealed, arguing that the trial court erred by failing to apply his excess custody credits (297 days) to reduce his $200 restitution fine. Held: Judgment modified. Under Penal Code section 2900.5, a defendant’s excess custody credits may be used to reduce certain fines at the rate of $30 per day. Restitution fines were included among those that could be reduced until the Legislature amended section 2900.5 in July 2013 (with an effective date of January 1, 2014). Because restitution fines are considered punishment, the ex post facto clause requires that the restitution fine be governed by the law that was in effect at the time the offense was committed. (People v. Souza (2012) 54 Cal.4th 90, 143.) Here, Morris committed his offense before the January 1, 2014 effective date of the amendment to section 2900.5. Thus, his excess custody credits could be used to reduce his $200 restitution fine at a rate of $30 per day. Since Morris had 297 days of excess credits, the Court of Appeal deemed the fine satisfied.