
133 Cal.App.3d 38 (1982)
183 Cal. Rptr. 709
THE PEOPLE, Plaintiff and Respondent,
v.
MANUEL CURTIS GILCHRIST, Defendant and Appellant.
Docket No. 11642.
Court of Appeals of California, Third District.
June 23, 1982.
*41 COUNSEL
Latimer & Kenkel and Jerry J. Kenkel for Defendant and Appellant.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Arnold O. Overoye, Assistant Attorney General, Joel E. Carey and J. Robert Jibson, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
ABBE, J.[*]
This case presents a problem of whether the law requires a retroactive application of the maximum period of probation under the determinate sentence law (DSL) to persons who were placed on probation prior to the effective date of that law. We conclude it does not.
*42 Defendant was sentenced to state prison for offering to sell cocaine (Health & Saf. Code, § 11352) following an order revoking his probation. (1) (See fn. 1.) On appeal[1] defendant challenges the order revoking probation contending: (1) the trial court lacked jurisdiction to revoke probation as his probationary period should have expired prior to the notice of revocation; and (2) he in no way consented to an extension of his probationary period beyond the maximum permissible period.

I
On June 7, 1974, defendant was placed on probation by the Los Angeles County Superior Court for five years following his guilty plea and conviction on a charge of offering to sell cocaine. (Health & Saf. Code, § 11352.) At that time, the penalty for that offense was imprisonment for five years to life. (Former Health & Saf. Code, § 11352, subd. (a).)
On April 19, 1978, probation was revoked and defendant was sent to state prison. On July 20, 1978, defendant was recalled from prison pursuant to Penal Code section 1170, subdivision (d)[2] and was reinstated to probation for a period of three years. On August 21, 1979, defendant's probation was transferred to Butte County. (See Pen. Code, § 1203.9.)
The instant petition for revocation of probation was filed May 1, 1981. It alleged defendant had violated the terms of his probation by engaging in the sale of drugs and failing to register as a drug offender. (Health & Saf. Code, § 11590.)
A probation revocation hearing was held July 17, 1981. At the outset of the hearing, defendant moved to dismiss the petition on the ground *43 his probationary period had expired prior to the notice of revocation and therefore the court lacked jurisdiction to sentence him. (Pen. Code, § 1203.1.)
The maximum amount of time to which defendant could presently be sentenced for the instant offense is five years. (Health & Saf. Code, § 11352.) Thus, the maximum period of probation which defendant could be given had he committed this offense after the operative date of the DSL (July 1, 1977) is five years. (Pen. Code, § 1203.1.)[3] When defendant was originally placed on probation his Indeterminate Sentence Law (ISL) term allowed for a maximum probationary period of life. (People v. Bittick (1960) 177 Cal. App.2d 479, 484 [2 Cal. Rptr. 378].) Defendant contends this disparity in the calculation of the maximum probation period, based solely on the date when his offense was committed, denies him equal protection of the law.
The trial court agreed with defendant's position, but ruled that when defendant accepted the terms of probation on July 20, 1978, including the three-year additional period, he consented to an extension of probation beyond what the trial court perceived to be the maximum period. The trial court held this consent avoided the equal protection problem and gave it jurisdiction to proceed in the matter. On appeal, defendant renews his equal protection argument and contends he did not consent to an extension of his probation beyond the maximum permissible period.

II
The trial court, presented with a novel and difficult problem, erred when it ruled that the maximum period of probation was five years but determined that defendant had consented to the extension. (2a) Pursuant to Penal Code section 1203.1, the Los Angeles court had authority in 1978 to do what it did, that is to reinstate defendant to probation by modifying and increasing the length of probation.
*44 (3) We have recently held "[t]he power of the court with regard to probation is strictly statutory, and the court cannot impose a condition of probation which extends beyond the maximum statutory period of probation." (In re Bolley (1982) 129 Cal. App.3d 555, 557 [181 Cal. Rptr. 111], citing In re Acosta (1944) 65 Cal. App.2d 63, 64 [149 Cal. Rptr. 757].) (4) If defendant's period of probation was five years' maximum, any attempt by the Los Angeles court to extend probation beyond that period would be null and void even had he consented. (In re Bolley, supra, at p. 557.) Defendant's consent could not authorize an act which was beyond the trial court's statutory power. (5) We must therefore address defendant's equal protection claim, as a proper ruling on the motion to dismiss, supported by substantial evidence, will not be reversed even though the trial court gave an incorrect reason for that ruling. (People v. Evans (1967) 249 Cal. App.2d 254, 257 [57 Cal. Rptr. 276].)

III
We note initially that were we to accept defendant's equal protection analysis an anomalous result would be reached. Defendant contends the Los Angeles Superior Court was limited to the balance of the original five-year period when it reinstated him to probation in 1978. The Los Angeles court's choices then upon resentencing in 1978 would have consisted of a prison sentence of five years to life or a probation period of one more year. This result seems particularly anomalous when the trial court's probable rationale for recalling defendant from prison was to release him on probation, apparently feeling probation a more appropriate disposition. If that court had only those choices the defendant might have gone to prison in 1978 and still be there.

IV
Defendant contends the state has arbitrarily discriminated between probationers who committed their offenses prior to and after the effective date of the DSL for two reasons: first, disparate treatment of incarcerated persons based on an arbitrary date violates equal protection; and second, the Legislature has granted the benefits of a shortened period of imprisonment to certain inmates sentenced under the ISL whose release date would be sooner had they been sentenced under the DSL. (See Pen. Code, § 1170.2.)
*45 (6) The Fourteenth Amendment to the United States Constitution and article I, section 7, subdivision (b) and article IV, section 16 of the California Constitution require that legislative classifications among persons subject to the state's jurisdiction to whom the state accords and withholds substantial benefits must be reasonably related to a legitimate public purpose. (In re Kapperman (1974) 11 Cal.3d 542, 545 [114 Cal. Rptr. 97, 522 P.2d 657].) It is therefore our task to apply this test to probationers who receive disparate treatment based on the date the offense was committed.
(7a) Defendant's sentence, imposed under the ISL, remains valid, despite the revision of the entire sentencing structure. (In re Gray (1978) 85 Cal. App.3d 255, 262 [149 Cal. Rptr. 416]; In re Brown (1978) 78 Cal. App.3d 647, 652 [143 Cal. Rptr. 549].) (8) It is perfectly proper for the Legislature to create a new sentencing procedure which operates prospectively only. Despite the disparity created by rendering different sentences after an admittedly arbitrarily chosen date, prospective application of such a statute does not violate equal protection principles, because of the legitimate public purpose of assuring "that penal laws will maintain their desired deterrent effect by carrying out the original prescribed punishment as written." (In re Kapperman, supra, 11 Cal.3d at pp. 546.)
Defendant's analogy to Penal Code section 1170.2 is inappropriate for several reasons. The Legislature chose to retroactively apply the benefit of a DSL-determined release date to some prisoners who committed offenses prior to July 1, 1977. However, not all inmates are accorded that benefit. If upon hearing, two members of the Board of Prison Terms feel an inmate sentenced under ISL should not be released at an earlier DSL-determined date, a serious offender hearing is held and the inmate's release date may be set at any time up to the limits of the originally imposed indeterminate sentence. (Pen. Code, § 1170.2, subd. (b).)[4] It is entirely reasonable for the Legislature to distinguish *46 between inmates affected by Penal Code section 1170.2 (as well as between persons who committed their crimes before and after July 1, 1977) based on the facts of the conviction such as whether the person was armed, used a deadly weapon, inflicted harm on the victim, and the number of the inmate's present or prior convictions because of the compelling state interest in preventing extraordinary crimes of violence against the person. (In re Greenwood (1978) 87 Cal. App.3d 777, 784 [151 Cal. Rptr. 223].) An inmate's conviction and sentence may be unaffected by the advent of the DSL. The Legislature has not given the DSL complete retroactive affect, but has provided that the Board of Prison Terms may consider the ameliorative effects of the DSL in determining the release date of ISL inmates. (In re Gray, supra, 85 Cal. App.3d at p. 262.)
(7b) The decision to accord the DSL a limited retroactive effect to certain inmates does not require that we overturn the Legislature's intent in the case of probationers to give the DSL prospective effect only. Defendant's citation to the cases In re Henson (1981) 123 Cal. App.3d 518 [176 Cal. Rptr. 693], In re Morales (1981) 115 Cal. App.3d 456 [171 Cal. Rptr. 425], and In re Thomson (1980) 104 Cal. App.3d 950 [164 Cal. Rptr. 99], is not persuasive as those cases involved persons who were not on probation but rather were either incarcerated or on parole and thus in custody. (See Pen. Code, § 3000, subd. (d).)
Thomson involved a situation where an amendment to section 3000, passed between the time Thomson was sentenced and released on parole, increased his term of parole from one to three years. The court held retroactive application violated both the ex post facto and equal protection clauses. The principle that defendant cannot be made to serve a longer sentence than that which was originally imposed is not applicable here, as probation is not a part of defendant's sentence.[5]
*47 Morales involved retroactive application of DSL maximum terms to persons incarcerated in the California Rehabilitation Center under ISL sentences. The Morales court specifically found the CRC commitment procedure already provided a hearing procedure through which the DSL terms could be determined, alleviating any potential burden from having to recalculate the terms of those committed prior to the DSL effective date. (In re Morales, supra, 115 Cal. App.3d at p. 461.) Such reasoning cannot be advanced here, where no hearing procedure to redetermine the probationary periods of the large number of ISL probationers exists. Any modification of a probationer's period would have to be made by the superior court having jurisdiction (see Pen. Code, § 1203.2, subd. (b)), and the forced recalculation of the maximum period of every ISL probationer would indeed be a burden on such courts, contrary to the reasoning of Morales.
In re Henson involved a change in regulations affecting the criteria to be used to decide how long a life prisoner stays in prison. The test announced in that case does not apply to the question of the length of probation. (In re Henson, supra, 123 Cal. App.3d at p. 522.)
Defendant incorrectly perceives probationers as inmates and probation as punishment. A term of punishment may not, of course, be extended by the trial court beyond the balance of the originally imposed period. Probation is not a form of punishment, however, but rather an act of clemency within the sound discretion of the trial court. (People v. Morrison (1980) 109 Cal. App.3d 378, 383 [167 Cal. Rptr. 276].) Its primary purpose is rehabilitation and not punishment. (People v. Angus (1980) 114 Cal. App.3d 973, 989 [171 Cal. Rptr. 5].) Persons placed on probation are not in similar situations as inmates or parolees. It is entirely reasonable for the Legislature to decide that those persons who committed an offense prior to July 1, 1977, and were granted probation, be required to fulfill the original or modified terms and conditions of the probation order under which this act of clemency was made, despite the disparity in maximum probationary periods created by the advent of the DSL. Moreover, if the Legislature intended to retroactively apply the maximum DSL terms to probationary periods, Penal Code section 3 requires that such intent be expressed. The drafters of the DSL clearly considered ISL probationers continuing on probation for the ISL established period. They noted courts will be giving ISL sentences far into the future, because of future ISL probation violations. (See People v. Superior Court (Gonzales) (1978) 78 Cal. App.3d 134, *48 140 [144 Cal. Rptr. 89]; citing to the bill analysis of Assembly Bill No. 476; Stats. 1977, ch. 165.)
Equal protection of the law does not require retroactive application of the maximum DSL probationary periods to persons who committed offenses prior to July 1, 1977, for the reasons herein stated. (2b) The probation period had not expired when the defendant was found to have violated his probation. The trial court therefore had jurisdiction to entertain and rule on the petition. (Pen. Code, § 1203.2, subd. (b).) Defendant does not challenge the merits of the petition or the order revoking probation.
The judgment is affirmed.
Puglia, P.J., and Regan, J., concurred.
Appellant's petition for a hearing by the Supreme Court was denied October 6, 1982.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
[1]  Defendant purports to appeal from the order revoking probation. This order is not in itself an appealable order, but rather is an intermediate order reviewable on appeal from the judgment. (People v. Robinson (1954) 43 Cal.2d 143, 145 [271 P.2d 872].) Where, however, defendant's notice of appeal was filed the same day as the judgment of commitment was announced and respondent has suffered no prejudice from the improper designation, the notice of appeal may be construed as sufficient to constitute an appeal from the "judgment" as authorized and as counsel for defendant apparently intended. (Id. at p. 146.)
[2]  Penal Code section 1170, subdivision (d) provides in relevant part: "When a defendant subject to this section or subdivision (b) of Section 1168 has been sentenced to be imprisoned in the state prison and has been committed to the custody of the Director of Corrections, the court may, within 120 days of the date of commitment on its own motion, or at any time upon the recommendation of the Director of Corrections or the Board of Prison Terms, recall the sentence and commitment previously ordered and resentence the defendant in the same manner as if he had not previously been sentenced, provided the new sentence, if any, is no greater than the initial sentence...."
[3]  Penal Code section 1203.1 provides in relevant part: "The court or judge thereof, in the order granting probation, may suspend the imposing, or the execution of the sentence and may direct that such suspension may continue for such period of time not exceeding the maximum possible term of such sentence, except as hereinafter set forth, and upon such terms and conditions as it shall determine.

"... should the probationer violate any terms or conditions imposed by the court in the instant matter, it shall have authority to modify and change any and all such terms and conditions...."
[4]  Penal Code section 1170.2, subdivision (b) provides in relevant part: "If the calculation required under subdivision (a) is less than the time to be served prior to a release date set prior to July 1, 1977, or if a release date had not been set, the Board of Prison Terms shall establish the prisoner's parole date, subject to subdivision (d), on the date calculated under subdivision (a) unless at least two of the members of the Board of Prison Terms after reviewing the prisoner's file, determine that due to the number of crimes of which the prisoner was convicted, or due to the number of prior convictions suffered by the prisoner, or due to the fact that the prisoner was armed with a deadly weapon when the crime was committed, or used a deadly weapon during the commission of the crime, or inflicted or attempted to inflict great bodily injury on the victim of the crime, the prisoner should serve a term longer than that calculated in subdivision (a), in which event the prisoner shall be entitled to a hearing before a panel consisting of at least two members of the Board of Prison Terms as provided for in Section 3041.5.... At such hearing ... a release date shall be set, and the prisoner shall be informed in writing of the extraordinary factors specifically considered determinative and on what basis the release date has been calculated."
[5]  Parole is clearly part of defendant's sentence during which he is considered to be still in custody. (See Pen. Code, §§ 1170, subd. (c) and 3000, subd. (d).)
