
33 Cal.3d 223 (1983)
655 P.2d 723
188 Cal. Rptr. 371
THE PEOPLE, Plaintiff and Respondent,
v.
CARL ANTHONY RIOLO, Defendant and Appellant.
Docket No. Crim. 22784.
Supreme Court of California.
January 10, 1983.
*224 COUNSEL
Quin Denvir, State Public Defender, under appointment by the Court of Appeal, William Blum and Russell L. Lynn, Deputy State Public Defenders, for Defendant and Appellant.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, S. Clark Moore, Assistant Attorney General, Roy C. Preminger, Shunji Asari and Pamela M. Nelson, Deputy Attorneys General, for Plaintiff and Respondent.
*225 OPINION
BIRD, C.J.
The sole issue raised by this appeal is appellant's right to have credited against his consecutive prison terms the days he served in custody both prior to conviction and as a condition of probation.

I.
In June of 1981, appellant entered a plea of nolo contendere to a charge of second degree burglary. (Super. Ct. No. 136395; Pen. Code, §§ 459, 460.[1]) He was sentenced to prison for the upper base term of three years. (§§ 18, 461.)
At the time, appellant was on probation for two separate prior convictions. (Nos. 131708 and 127947.) The trial court revoked his probation in both of those cases. Consecutive sentences were imposed to run concurrently with each other, but consecutive to the three-year term for the burglary. Pursuant to section 1170.1, subdivision (a), the consecutive sentences for the prior convictions amounted to one-third of the middle base term for the charges  eight months. Appellant's total sentence thus amounted to a term of three years and eight months.
As to the burglary charge, appellant received credit for time served in custody before sentencing. However, the trial court denied his request for credit for time served on the prior convictions. In both of those cases, appellant spent time in custody before sentencing and also served several months in county jail as a condition of probation. He claimed credits of 276 days in one case (No. 131708) and 198 days in the other (No. 127947).[2]
Appellant challenges the denial of credit for time served, arguing that the time he served on the prior convictions should be deducted from his prison sentences for those crimes.

II.
Section 2900.5, subdivision (a) provides in pertinent part, "In all felony and misdemeanor convictions, either by plea or by verdict, when the defendant has been in custody, ... all days of custody of the defendant, including days served as a condition of probation in compliance with a court order, and including *226 days credited to the period of confinement pursuant to Section 4019,[[3]] shall be credited upon his term of imprisonment...."[4]
The Attorney General concedes that credit generally must be awarded both for presentence time in custody and for time served as a condition of probation. Indeed, the clear language of the statute leaves no room for debate on that question. However, the Attorney General argues that when a conviction results in a consecutive term, with a sentence of one-third the middle base term for the offense, credit for time served somehow should be deducted from the hypothetical term that would have been imposed if the sentence had not been consecutive to another prison term  i.e., from the full base term for the offense plus any relevant enhancements  rather than from the sentence actually imposed.
(1a) This suggested procedure is directly contrary to the express provisions of sections 1170.1 and 2900.5. Section 2900.5, subdivision (a) mandates that all days of custody served for an offense be deducted from the "term of imprisonment" imposed for the offense. Subdivision (a) of section 1170.1 defines the "term of imprisonment" for a consecutive offense as one-third the middle base term for the offense. Read together, the statutes clearly specify that credits be deducted from the term of imprisonment prescribed by section 1170.1, one-third the middle base term.
*227 The hypothetical term referred to by the Attorney General, a full base term plus enhancements, has no meaning in the statutory provisions for consecutive sentences. Once the trial court has determined that the sentence for an offense will be consecutive to a principal term, the court must impose the consecutive term defined by section 1170.1, subdivision (a). That term is the "term of imprisonment" for the offense, and, therefore, the term from which credits must be deducted.[5]
The argument that the phrase "term of imprisonment" in section 2900.5 refers to some hypothetical unimposed sentence for the consecutive offense is further refuted by the definition of that phrase in subdivision (c) of section 2900.5, and by its use in other sections of the Penal Code. Subdivision (c) provides in part, "For the purposes of [section 2900.5], `term of imprisonment' includes any period of imprisonment imposed as a condition of probation or otherwise ordered by a court in imposing or suspending the imposition of any sentence, and also includes any term of imprisonment, including any period of imprisonment prior to release on parole and any period of imprisonment and parole, prior to discharge...."
So defined, "term of imprisonment" must refer to the actual sentence imposed by the court, not to the sentence that might have been imposed by the court under other circumstances. For example, "term of imprisonment" includes the "period of imprisonment imposed" as a condition of probation, not the prison term that could have been imposed if probation had not been granted. Similarly, it includes the actual period of imprisonment or of imprisonment and parole imposed by the court, not some other hypothetical sentence an accused could have received. Just as clearly, then, it must include the actual consecutive term imposed by the court, not the full term that could have been imposed if the sentence had not been consecutive. Appellant's "term of imprisonment" for each of the prior convictions is the eight-month term imposed by the court, not the two-year term that could have been imposed if there had been no principal term for burglary.
"Term" and "term of imprisonment" are used elsewhere in the Penal Code to refer to actual time of custody imposed by the court. For instance, section 1170.1, subdivision (g) imposes a limit on the sentence which may be imposed *228 in certain cases, stating that the "term of imprisonment shall not exceed twice" the base term imposed by the trial court. (Italics added.) Section 2931 authorizes the Department of Corrections to give specified credits for good behavior to "reduce the term prescribed ..." (italics added) and section 3000, subdivision (a) states that "[a]t the expiration of a term of imprisonment ... the inmate shall be released on parole ..." (italics added). All three of these statutes would be meaningless if "term" or "term of imprisonment" were read to mean a hypothetical unimposed sentence, as the Attorney General suggests in this case.
Although this court and the Courts of Appeal have never directly decided this issue, the identical question was discussed in the recent case of In re Ricky H. (1981) 30 Cal.3d 176, 185, footnote 7 [178 Cal. Rptr. 324, 636 P.2d 13]. In that case, the court concluded, inter alia, that the appellant was not entitled to credit for time served on his prior burglary offenses because no portion of his term was attributable to the burglaries. (Id., at p. 185.) The court noted, however, that if appellant's time in custody had been affected by the burglaries, he would have been entitled to credit. "Thus, if the juvenile court had elected to impose an eight-month consecutive term for one of the burglary counts (§ 726, 4th par.; Pen. Code, § 1170.1, subd. (a)), appellant would be entitled to credit against that term for the actual number of days in confinement" attributable to the burglary. (Id., at p. 185, fn. 7.)
The Attorney General recognizes that this language is directly on point. It is argued only that it is dictum. Although dictum and, therefore, not controlling, the Ricky H. language is nonetheless a correct assessment of the law.
The interpretation of section 2900.5 mentioned in Ricky H. and adopted here conforms to the twofold purpose of the statute. (2) Section 2900.5 "eliminate[s] the unequal treatment suffered by indigent defendants who, because of their inability to post bail, serve[] a longer overall confinement than their wealthier counterparts. [Citations.]" (In re Rojas (1979) 23 Cal.3d 152, 156 [151 Cal. Rptr. 649, 588 P.2d 789]; People v. Galloway (1980) 107 Cal. App.3d 709, 713 [165 Cal. Rptr. 771]; In re Hodges (1979) 89 Cal. App.3d 221, 225-226 [152 Cal. Rptr. 394].) In addition, the statute helps to equalize the actual time served in custody for given offenses. (People v. Williams (1975) 53 Cal. App.3d 720, 723 [125 Cal. Rptr. 901].) Thus, it awards credit not only for pretrial custody which is the result of the inability to post bail, but also for time served as a condition of probation and for pretrial custody which is not the result of indigency (In re Kapperman (1974) 11 Cal.3d 542, 549 [114 Cal. Rptr. 97, 522 P.2d 657]). "[S]ection[] 2900.5 ... reflect[s] the basic philosophy that when a person is incarcerated he is being punished by the reality of incarceration. Thus, ... any presentence time is credited towards his ultimate sentence." (Williams, supra, 53 Cal. App.3d at p. 723.)
*229 (1b) Denying credit to persons in appellant's situation would frustrate the intent of section 2900.5. The denial of credit for presentence custody would create a disparity between those able to post bail and indigents who must remain in jail pending verdict or plea. And the denial of credit for time served as a condition of probation would require some defendants to serve more total time in custody than others, despite a clear legislative directive that credit should be awarded for time served as a condition of probation.
The conclusion that appellant is entitled to credit for time served on his consecutive sentence is also supported by the regulations of the Board of Prison Terms. Section 2344 of title 15 of the California Administrative Code provides that all custody credit "attributable to any consecutive crime shall be deducted from the ... subordinate term...." (Cal. Admin. Code, tit. 15, § 2344, subd. (c)(1).) This interpretation of the governing statute is entitled to great weight as the administrative interpretation of a statute by the agency authorized to implement its provisions. (See, e.g., Judson Steel Corp. v. Workers' Comp. Appeals Bd. (1978) 22 Cal.3d 658, 668 [150 Cal. Rptr. 250, 586 P.2d 564].)
The Attorney General's final argument rests on policy considerations. It is claimed that the purpose of the consecutive sentence would be thwarted if a defendant were granted substantial credit for time served prior to sentencing. The Attorney General expresses concern about individuals who have accumulated credits equal to or greater than one-third the middle base term for an offense. Those individuals would know that a consecutive sentence based on that offense would not result in any additional incarceration, since the credits would be equal to or greater than the sentence.
However, this situation arises whenever an accused serves a substantial period in custody before sentencing if the period in custody approximates the sentence to be imposed for the offense. The Legislature clearly envisioned this possibility and expressly provided for it. Section 2900.5, subdivision (a) states, "If the total number of days in custody exceeds the number of days of the term of imprisonment to be imposed, the entire term of imprisonment shall be deemed to have been served." Section 1170, subdivision (a)(2) reiterates this, stating, "In any case in which the amount of preimprisonment credit under Section 2900.5 or any other provision of law is equal to or exceeds any sentence imposed pursuant to this chapter, the entire sentence, including any period of parole ..., shall be deemed to have been served and the defendant shall not be actually delivered to the custody of the Director of Corrections." There is no reason to treat consecutive sentences differently under this law than any other term of imprisonment.
The Attorney General's claim that probationers who commit additional crimes while on probation will escape punishment for their prior crimes is also *230 unfounded. Probationers in this situation do not receive unearned "gifts" of credits, but reductions in their sentences to reflect time which they have already served in custody. They have already been punished, at least in part. Further, the fact that a defendant was on probation at the time of a new offense may be used as the basis for imposition of the aggravated base term for the new offense. (Cal. Rules of Court, rule 421 (b)(4).) And the probationer always faces the possibility of being required to serve the full term for the prior offense if the new conviction is reversed.
The Attorney General also attacks the statutory system by which consecutive sentences are calculated. However, this misses the point. The merits of the statutory sentencing scheme are not before the court. Further, such arguments are properly addressed to the Legislature, not this court. The language of the governing statute is clear. Appellant is entitled to credit on his consecutive sentences for time previously served on those charges.

III.
This case is remanded to the trial court, with directions to amend the judgment to award appellant credit for time served, as required by the views expressed herein.
Mosk, J., Richardson, J., Kaus, J., Broussard, J., Reynoso, J., and Chapman, J.,[*] concurred.
NOTES
[1]  All statutory references are to the Penal Code, unless otherwise noted.
[2]  Appellant asserts that he was in custody in case No. 131708 for 184 days, and earned conduct credits of 92 days, for a total of 276 days' credit. In case No. 127947, he served 132 days, and claims conduct credits of 66 days, for a total of 198 days. (See §§ 2900.5; 4019.)
[3]  Section 4019 provides for conduct credits for "work performance" and "good behavior" (good time and work time credits).
[4]  Subdivisions (a), (b) and (c) of section 2900.5 provide as follows:

"(a) 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, camp, work furlough facility, halfway house, rehabilitation facility, hospital, prison, juvenile detention facility, or similar residential institution, all days of custody of the defendant, including days served as a condition of probation in compliance with a court order, and including days credited to the period of confinement pursuant to Section 4019, shall be credited upon his term of imprisonment, or credited to any fine which may be imposed, at the rate of not less than thirty dollars ($30) per day, or more, in the discretion of the court imposing the sentence. If the total number of days in custody exceeds the number of days of the term of imprisonment to be imposed, the entire term of imprisonment shall be deemed to have been served. In any case where the court has imposed both a prison or jail term of imprisonment and a fine, any days to be credited to the defendant shall first be applied to the term of imprisonment imposed, and thereafter such remaining days, if any, shall be applied to the fine.
"(b) For the purposes of this section, credit shall be given only where the custody to be credited is attributable to proceedings related to the same conduct for which the defendant has been convicted. Credit shall be given only once for a single period of custody attributable to multiple offenses for which a consecutive sentence is imposed.
"(c) For the purposes of this section, `term of imprisonment' includes any period of imprisonment imposed as a condition of probation or otherwise ordered by a court in imposing or suspending the imposition of any sentence, and also includes any term of imprisonment, including any period of imprisonment prior to release on parole and any period of imprisonment and parole, prior to discharge, whether established or fixed by statute, by any court, or by any duly authorized administrative agency."
[5]  California Rules of Court, rule 449, requires the trial court to compute the full term, including enhancements, for each conviction independently. The rule directs the trial court to "stay execution" of whatever portion of the full term cannot be imposed because of statutory limitations on consecutive sentences.

This system may have some administrative value. However, the administrative concept that a portion of the consecutive term is "stayed" does not alter the fact that the statutes define the sentence on the consecutive offense as one-third the middle base term. Neither the hypothetical full term for the offense nor the concept of a "stay" of part of that "term" appears in the statutes. As long as the consecutive term remains subordinate to a principal term, its term of imprisonment is the period of time amounting to one-third the middle base term.
[*]   Assigned by the Chairperson of the Judicial Council.
