The assessments under Penal Code section 1465.8, subdivision (a)(1) and Government Code section 70373 are mandatory and cannot be satisfied by jail time pursuant to Penal Code section 2900.5, subdivision (a). Appellant was convicted of petty theft and sentenced to 180 days jail, with credit for 253 days. On a Wende review, the court determined that the trial court erred in failing to impose the $40 court operations assessment and the $30 court facilities assessments because, under the relevant statutes, the costs are mandatory. Since they are a required part of the sentence, the failure to impose them can be corrected on appeal. Appellant’s contention that the time he served in excess of his sentence should be credited against the costs, pursuant to section 2900.5, subdivision (a), was rejected. Although the statute provides that excess days in custody can be credited to court-ordered costs imposed for punitive purposes, the costs at issue here were imposed for nonpunitive purposes and, therefore, do not fall within the section 2900.5 provision.