Where a defendant is sentenced after the effective date of the amendment to Penal Code section 4019, he receives the benefit of the statute for the entire period of presentence custody regardless of the fact that some of the time in custody occurred prior to the amendment. At appellant’s February 2010 sentencing, the trial court awarded presentence conduct credits under two versions of Penal Code section 4019. For time spent in custody before January 25, 2010, the court awarded presentence conduct credits under the formula described by former section 4019, and gave presentence conduct credits under the formula in the amended version for time spent in custody after its effective date. The appellate court agreed with appellant’s contention that the trial court should have applied the amended version to the entire period of custody. It is at the time of sentencing that the court is required to calculate the exact number of actual days in custody, add applicable conduct credits earned, and reflect the total in the abstract of judgment. (People v. Buckhalter (2001) 26 Cal.4th 20, 30.) There was only one version of section 4019 in existence at the time of appellant’s sentencing, the amended version. The former version was no longer valid. The court’s sentence was unauthorized to the extent it applied the prior version of the statute. The court noted this is not a retroactivity issue. The statute is being applied prospectively in appellant’s case because that version of the statute was the only one in existence on the date of sentencing.