McDONALD, J.
Salvador Briceno Zarate appeals a judgment following his plea of no contest to one count of sale or transportation of marijuana (Health Saf. Code, § 11360, subd. (a)). On appeal, he contends the trial court erred at his February 2010 sentencing by awarding him conduct credit for local custody time served before January 25, 2010, in accordance with a former version of Penal Code section 4019 rather than the amended version in effect on the date of his sentencing. We conclude the trial court erred by not applying the amended version of section 4019 to all of the days served by Zarate in presentence local custody.
All further statutory references are to the Penal Code unless otherwise pecified.
FACTUAL AND PROCEDURAL BACKGROUND
On or about November 2, 2009, Zarate transported marijuana in Imperial County. On January 28, 2010, an information charged him with one count of sale or transportation of marijuana (Health Saf. Code, § 11360, subd. (a)) and one count of possession of marijuana for sale (Health Saf. Code, § 11359).
On February 18, 2010, pursuant to a plea agreement, Zarate pleaded no contest to the Health and Safety Code section 11360, subdivision (a), count with a stipulated sentence of two years in state prison; the other count was then dismissed. At that hearing, the trial court sentenced Zarate to two years in state prison and awarded him a total of 115 days of presentence custody credit. The court awarded Zarate 22 days of conduct credit for 44 days in actual custody before January 25 and 24 days of conduct credit for 25 days in actual custody on and after that date. The court denied Zarate's request for "day for day" conduct credit for all of his days in custody pursuant to the "new law" (i.e., amended § 4019), including his days served in custody prior to January 25. Zarate timely filed a notice of appeal.
DISCUSSION I Actual Custody and Conduct Credits Generally
A defendant "sentenced to prison for criminal conduct is entitled to credit against his [or her] term for all actual days of [presentence] confinement solely attributable to the same conduct. [Citations.]" ( People v. Buckhalter (2001) 26 Cal.4th 20, 30 [ 108 Cal.Rptr.2d 625, 25 P.3d 1103] ( Buckhalter).) That confinement or custody includes days spent in jail before sentencing. (§ 2900.5, subd. (a).) Pursuant to section 4019, a defendant may also earn "conduct credit" for good behavior (i.e., compliance with rules and regulations) and satisfactory performance of any labor assigned him or her during presentence custody. (§ 4019, subds. (b), (c); People v. Dieck (2009) 46 Cal.4th 934, 939, fn. 3 [ 95 Cal.Rptr.3d 408, 209 P.3d 623]; Buckhalter, at p. 30.)
Section 2900.5, subdivision (a), provides: "In all felony and misdemeanor convictions, either by plea or by verdict, when the defendant has been in custody, including, but not limited to, any time spent in a jail . . ., all days of custody of the defendant, . . . including days credited to the period of confinement pursuant to Section 4019, shall be credited upon his or her term of imprisonment. . . ." (Italics added.) Section 2900.5, subdivision (d), provides: " It shall be the duty of the court imposing the sentence to determine the date or dates of any admission to, and release from, custody prior to sentencing and the total number of days to be credited pursuant to this section. The total number of days to be credited shall be contained in the abstract of judgment provided for in Section 1213." (Italics added.) The California Supreme Court has stated that when a trial court imposes asentence, it "has responsibility to calculate the exact number of days the defendant has been in custody `prior to sentencing,' add applicable good behavior credits earned pursuant to section 4019, and reflect the total in the abstract of judgment." ( Buckhalter, supra, 26 Cal.4th at p. 30.)
Prior to January 25, 2010, a former version of section 4019 (1982 version) provided that a defendant earned two days of conduct credit for every four actual days in local custody. (Stats. 1982, ch. 1234, § 7, pp. 45534554.) However, section 4019 was amended, effective January 25, 2010, to provide qualifying defendants with increased conduct credit of two days for every two actual days in local custody. (Stats. 2009, 3d Ex. Sess. 2009-2010, ch. 28, § 50.) That amended version of section 4019 provided: "It is the intent of the Legislature that if all days are earned under this section, a term of four days will be deemed to have been served for every two days spent in actual custody. . . ." (Former § 4019, subd. (f).) The provisions of section 4019 apply to those defendants confined in a county jail for time served, "including all days of custody from the date of arrest to the date on which the serving of the sentence commences, under a judgment of imprisonment" or, alternatively, for time served "following arrest and prior to the imposition of sentence for a felony conviction." (Former § 4019, subd. (a)(1), (4).)
Pursuant to the January 25, 2010, version of section 4019, defendants can qualify for such conduct credit unless they have current or prior convictions for serious or violent felony offenses or are required to register as sex offenders. (§ 4019, former subds. (b)(2), (c)(2), as amended by Stats. 2009, 3d Ex. Sess. 2009-2010, ch. 28, § 50.)
Section 4019 was amended again, effective September 28, 2010, to reinstate the conduct credit provisions that applied before the January 25, 2010, amendment, but that version applies only to local custody served by defendants for crimes committed on or after September 28, 2010. (Stats. 2010, ch. 426, § 2.) The most recent amendment to section 4019 is inapplicable to Zarate's case because his crime was committed in November 2009. Unless otherwise specified, all references to section 4019 or its amendments refer to section 4019, as amended effective January 25, 2010, pursuant to Statutes 2009, Third Extraordinary Session 2009-2010, chapter 28, section 50.
II Trial Court's Calculation of Section 4019 Conduct Credit
Zarate contends the trial court erred in sentencing him by applying the 1982 version of section 4019 to time he was in local custody prior to January 25, 2010, and thereby awarding him only 22 days of conduct credit for the 44 actual days he was in custody during that period. He asserts the court was required to apply the January 25, 2010, amended version of section 4019 in effect on the date of his sentencing (Feb. 18, 2010) to all time he was in local custody, whether before or after January 25, 2010. He argues he should have received 44 days of conduct credit for the 44 actual days he was in custody prior to January 25, 2010, for a total of 68 days of conduct credit for all 69 actual days in custody prior to his February 18 sentencing.
We conclude the trial court erred in sentencing Zarate on February 18, 2010, by applying a former version of section 4019 to the time he served in local custody prior to January 25, 2010. At the time of his sentencing on February 18, the trial court was required to calculate the exact number of days Zarate had been in custody prior to sentencing, add applicable conduct credits earned pursuant to section 4019, and reflect the total in the abstract of judgment. (§ 2900.5, subds. (a), (d); Buckhalter, supra, 26 Cal.4th at p. 30.) At the time of Zarate's sentencing on February 18, there was only one version of section 4019 in existence (i.e., the amended version of § 4019 effective Jan. 25). The trial court was required to calculate Zarate's presentence conduct credit pursuant to that version of section 4019.
There is nothing in the January 25, 2010, amended version of section 4019 that authorized the trial court to apply both the 1982 and January 25, 2010, amended versions of section 4019 and use a two-part approach in calculating Zarate's conduct credit based on whether his presentence custody was served before or after January 25, 2010. Because the 1982 version of section 4019 was no longer valid at the time of Zarate's sentencing on February 18, the trial court erred in applying the 1982 version of section 4019 in calculating his conduct credit for presentence custody served before January 25. The court's sentence was unauthorized to the extent the court applied the 1982 version of section 4019 to calculate, in part, Zarate's presentence conduct credit. "A sentence that fails to award legally mandated custody credit is unauthorized and may be corrected whenever discovered." ( People v. Taylor (2004) 119 Cal.App.4th 628, 647 [ 14 Cal.Rptr.3d 550].) Therefore, we award Zarate an additional 22 days of presentence custody credit, for a total of 137 days of presentence custody credit. ( Ibid.)
Although the People argue the January 25, 2010, amended version of section 4019 should be applied prospectively and not retroactively, we do not consider the issue to involve retroactivity. The January 25, 2010, amended version of section 4019 applies to any sentencing of a defendant by a trial court on or after January 25, 2010. Therefore, based on our discussion above, the January 25, 2010, amended version of section 4019 is being applied prospectively in Zarate's case because that version was effective January 25, 2010 (and he was sentenced on Feb. 18, 2010), and therefore was the only version of section 4019 in existence on the date of his sentencing.
Because Zarate was sentenced on February 18, 2010, we conclude the issue of whether the amended version of section 4019 should be applied prospectively or retroactively to those judgments appealed and not final as of January 25, 2010, which issue is currently before the California Supreme Court, is irrelevant to his case. (See, e.g., People v. Brown (2010) 182 Cal.App.4th 1354 [ 107 Cal.Rptr.3d 286], review granted June 9, 2010, S181963 [holding amended § 4019 applies retroactively to judgments not yet final]; People v. Rodriguez (2010) 183 Cal.App.4th 1 [ 107 Cal.Rptr.3d 460], review granted June 9, 2010, S181808 [holding amended § 4019 does not apply retroactively to judgments not yet final].)
However, as noted above, the present version of section 4019 will apply to sentencing of those defendants who committed their crimes on or after September 28, 2010. (Stats. 2010, ch. 426, § 2.)
DISPOSITION
The judgment is modified to award Zarate an additional 22 days of presentence conduct credit, for a total of 137 days of presentence custody credit. As so modified, the judgment is affirmed. The trial court is directed to amend its abstract of judgment to reflect this modification and forward a certified copy of the amended abstract of judgment to the Department of Corrections and Rehabilitation.
Aaron, J., concurred.