
140 Cal.App.3d 445 (1983)
189 Cal. Rptr. 497
THE PEOPLE, Plaintiff and Respondent,
v.
LONNIE JAY WILLIAMS, Defendant and Appellant.
Docket No. 6067.
Court of Appeals of California, Fifth District.
February 28, 1983.
*447 COUNSEL
Ann J. Howell, under appointment by the Court of Appeal, for Defendant and Appellant.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Arnold O. Overoye, Assistant Attorney General, Charles P. Just and Clayton S. Tanaka, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[*]]
OPINION
FRANSON, Acting P.J.
Appellant was charged with a burglary which occurred on July 24, 1981. It was also alleged that appellant had commited two prior felonies: (1) an attempted burglary on September 1, 1976, and (2) a *448 burglary on July 18, 1972. Finally, it was alleged that appellant had served a separate prison term for each of the two prior offenses and that a period of five years had not elapsed since the conclusion of the last prison term during which appellant had remained free of both prison custody and conviction of a felony. (Pen. Code, § 667.5, subd. (b).)
Appellant was found guilty of burglary and of both priors as charged. He was sentenced to state prison for a total term of five years comprised of the upper base term of three years for the burglary and one additional year for each of the two priors.
Since this appeal is concerned with alleged sentencing error, the facts are unimportant other than as stated in the opinion.


I. Dual Use of Prior Convictions[*]

II. Ex Post Facto
Appellant was sentenced to two additional years based on the two prior convictions. Both priors occurred before the determinate sentencing law (DSL) became operative on July 1, 1977. The new law provided the sole basis for the enhancements via Penal Code section 667.5, subdivision (b). (1a) Appellant asserts the imposition of the two additional years of imprisonment is prohibited under the constitutional prohibitions against ex post facto laws. Under the law existing at the time appellant committed the priors, he could not have received additional prison time. (2) A law has an ex post facto effect when it changes the punishment and inflicts a greater punishment than the law annexed to the crime when committed. (In re Stanworth (1982) 33 Cal.3d 176, 180 [187 Cal. Rptr. 783, 654 P.2d 1311].)
(1b) Appellant's argument is rejected. Statutes which prescribe enhanced penalties for subsequent offenses are clearly constitutional. Chief Justice Wallace declared over a century ago in Ex Parte Gutierrez (1873) 45 Cal. 429, 432: "The true principle in this respect is well expressed by Judge Cooley in his invaluable work upon Constitutional Limitations [(8th ed.) p. 553], as follows: `And a law is not objectionable as ex post facto which, in providing for the punishment of future offenses, authorizes the offender's conduct in the past to be taken into the account, and the punishment to be graduated accordingly. Heavier penalties are often provided by law for a second or any subsequent offense than for the first, and it has not been deemed objectionable that in providing *449 for such heavier penalties the prior conviction authorized to be taken into account may have taken place before the law was passed. In such cases it is the second or subsequent offense that is punished, not the first,' etc." (See also People v. Berutko (1969) 71 Cal.2d 84, 94-95 [77 Cal. Rptr. 217, 453 P.2d 721]; In re McVickers (1946) 29 Cal.2d 264, 270-271 [176 P.2d 40]; In re Rosencrantz (1928) 205 Cal. 534, 540 [271 P. 902].)
Appellant's previous sentences for his prior convictions were not increased by DSL; rather, his present sentence was enhanced because of his prior criminal activity. The enhancement in question, Penal Code section 667.5, subdivision (b), is not a substantive offense. If appellant had not been convicted of the underlying offense of burglary, he could not have been prosecuted and sentenced solely on the enhancement. Consequently, since the prior convictions were not elements of a substantive offense, the bar against ex post facto laws is inapplicable. (See In re McVickers, supra, 29 Cal.2d at pp. 270-271.)[1]
(3) Our conclusion is in accord with the purpose of ex post facto prohibitions which is to assure that legislative acts give fair warning of their effect and permit individuals to rely on their meaning until explicitly changed. (Weaver v. Graham (1981) 450 U.S. 24, 28-29 [67 L.Ed.2d 17, 22-23, 101 S.Ct. 960]; People v. Rocha (1982) 135 Cal. App.3d 590, 600-601 [186 Cal. Rptr. 132].) (1c) Penal Code section 667.5, subdivision (b) in its present form was in effect at the time appellant committed the instant offense. (Stats. 1980, ch. 587, § 3, p. 1596.) Thus, appellant was assured fair warning of the enhancement effect the statute would have on the crime of burglary which he ultimately committed. (See People v. Rocha, supra, at pp. 601-602.) For purposes of ex post facto analysis, the critical point of reference is the date the crime was committed, i.e., July 24, 1981. If the enhancement statute in question had taken effect after that date, then the bar against ex post facto laws would have applied. (See People v. Cuevas (1980) 111 Cal. App.3d 189, 200 [168 Cal. Rptr. 519].)

III. Equal Protection
(4) Appellant contends his enhancement for prior prison terms pursuant to Penal Code section 667.5, subdivision (b) violates equal protection in according a greater effect to an in-state prior felony conviction (where the time served in prison need not be one year or more) as contrasted with the one-year *450 imprisonment requirement for out-of-state priors. (Compare Pen. Code, § 667.5, subds. (b) and (e) with subd. (f).)
While appellant's argument may have some logic as an abstract proposition of law, it fails pragmatically since appellant has failed to show he is being treated differently than any other defendant with a nonenhanceable out-of-state prior conviction, i.e., that he served less than one year in prison in California on either or both of his prior convictions. The record shows that appellant actually served more than one year in prison for each of his prior California convictions. Thus, appellant has no standing to assert the denial of the equal protection of the law insofar as the enhancement of his current offense because of his prior convictions.
The Attorney General has cited this court's opinion in People v. Hernandez (1979) 100 Cal. App.3d 637 [160 Cal. Rptr. 607] for the proposition that the enhancement required by Penal Code section 667.5 does not violate equal protection because, among other things, the enhancement does not involve a classification impinging upon a fundamental interest. (5) We wish to issue a caveat on this particular point: in light of recent developments in equal protection analysis concerning prisoners' rights to parole release dates and in-prison conduct credits based on the law at the time their crimes were committed (Weaver v. Graham, supra, 450 U.S. 24; In re Stanworth, supra, 33 Cal.3d 176), it becomes apparent that the enhancement of a crime for purposes of punishment involves the deprivation of a fundamental liberty interest to the end the state must show a compelling interest for any disparity in treatment of prisoners similarly situated. We therefore disapprove of the following language in People v. Hernandez: "We believe that there is a qualitative difference... between the initial interest one has in retaining his liberty prior to sentencing and the interest one has in whether or not an enhancement applies. The latter situation is more analogous to the case dealing with the different statutory treatment of good behavior participation credits [citation] and credit for time served in custody prior to the commencement of a prison term. [Citation.] In these cases the rational basis test was applied as the proper test. [Citations.] [These] cases, as well as the instant situation, concern the effects of certain legislative enactments upon an individual's underlying sentence and actual time served and not whether that person is to be deprived of his liberty in the first place. As a result, the rational basis test properly controls in this instance in determining the validity of the legislative classification." (100 Cal. App.3d at p. 644, fn. 2.)
Assuming a defendant shows he has received a prior prison term enhancement because of a California prior where he served less than one year in prison on the prior, we do not believe a mere rational basis for such disparity in treatment would suffice for equal protection purposes. We make no further comment on the rationale of Hernandez, supra.
*451 The judgment is affirmed.
Andreen, J., and Martin, J., concurred.
NOTES
[*]   Part I is not published, as it does not meet the standards for publication contained in rule 976(b), California Rules of Court.
[*]   See footnote, ante, page 445.
[1]  In re McVickers, supra, 29 Cal.2d at page 271 also points out: "Similarly, as to the contention that punishment under a law which provides more severe punishment because of a prior conviction places the defendant twice in jeopardy for the first offense, it is held that `he is not again punished for the first offense, but the punishment for the second is increased.' (People v. Stanley (1873) 47 Cal. 113, 116....)"
