
117 Cal.App.3d 521 (1981)
172 Cal. Rptr. 783
In re NANCY M. DALTON on Habeas Corpus.
Docket No. 25028.
Court of Appeals of California, Fourth District, Division Two.
March 30, 1981.
*523 COUNSEL
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Daniel J. Kremer, Assistant Attorney General, A. Wells Petersen and Steven V. Adler, Deputy Attorneys General, for Appellant.
Quin Denvir, State Public Defender, Richard Lennon, Deputy State Public Defender, and Daniel Mrotek for Respondent.
OPINION
MORRIS, J.
Gladys Crawford, superintendent, California Institution for Women, appeals a superior court order granting a petition for a writ of habeas corpus and directing that respondent (petitioner in superior court), Nancy Dalton, be granted credit against her term and parole period, as calculated under the Determinate Sentencing Law, for outpatient time served under a commitment to the California Rehabilitation Center (CRC).
On April 16, 1975, respondent was convicted of forgery (Pen. Code, § 470). Following her conviction, criminal proceedings were suspended and respondent was committed to the CRC pursuant to Welfare and Institutions Code section 3051. From May 29, 1975, until December 31, 1975, she was confined at CRC. On January 1, 1976, she was released on outpatient status. During the remainder of her commitment to CRC she was periodically released and reconfined until she was ultimately excluded from the program and returned to the Los Angeles Superior Court where criminal proceedings were reinstated.
On March 7, 1980, respondent was sentenced to state prison for the term prescribed by law. She was given presentence credits of 1,485 days against her sentence under the Indeterminate Sentence Law (ISL). This included 590 days of CRC confinement and 892 days spent on outpatient status.
*524 At the time of respondent's conviction and commitment to CRC, Penal Code section 473 prescribed an indeterminate sentence of 1 to 14 years for the crime of forgery. (Stats. 1935, ch. 578, § 1, p. 1672.) Effective July 1, 1977, the Legislature enacted the determinate sentencing law (DSL). Under the new law forgery is punishable by imprisonment in the state prison for sixteen months, or two or three years or in the county jail for not more than one year. (Pen. Code, § 473, as amended by Stats. 1976, ch. 1139, § 211, p. 5121, operative July 1, 1977; Pen. Code, § 18, as amended by Stats. 1976, ch. 1139, § 98, p. 5089, operative July 1, 1977.)
Respondent's DSL term was fixed at 2 years, with credit for 612 days spent in custody prior to her delivery to the California Department of Corrections. This credit included 590 days of CRC confinement. It did not include any time spent as an outpatient from CRC. After allowance was made for good time credit, respondent's DSL release date was set for June 6, 1980. She was released on parole on June 6, 1980.[1]
Respondent's administrative appeal was denied and this litigation followed. The superior court granted a writ of habeas corpus allowing respondent additional credit against her DSL sentence for the 892 days spent on outpatient status while respondent was under commitment to CRC.
Appellant contends that respondent's term was lawfully calculated pursuant to the retroactive provisions of the DSL, and that respondent has no constitutional right to have her term reduced for the time spent as an outpatient from CRC.
(1a) The issue presented on appeal in this case is whether the Board of Prison Terms, in fixing the prison term under the DSL for a crime committed prior to July 1, 1977, is required to reduce the term calculated by the time spent on CRC outpatient status credited to the inmate under the law as it existed prior to July 1, 1977.[2] We hold that it is not.
*525 The resolution of this issue depends on the legal effect of several statutory changes enacted during the time respondent was under commitment to CRC.
At the time respondent was committed to CRC, Penal Code section 2900.5, subdivision (a) provided that all days of preconviction/presentence jail confinement "shall be credited upon [the defendant's] sentence" (Stats. 1971, ch. 1732, § 2, p. 3686); Penal Code section 1203.03, subdivision (f) provided that "time spent ... in confinement in a diagnostic facility of the Department of Corrections ... shall be credited on the term of imprisonment" (Stats. 1969, ch. 1195, § 1, p. 2330); and Welfare and Institutions Code section 3200 provided that, following CRC commitment, in any case where criminal proceedings are resumed and a defendant sentenced on the criminal charge, "time served while under commitment ... shall be credited on such sentence." (Stats. 1971, ch. 1486, § 2, p. 2931.) This statutory language contained two ambiguities; to wit, (1) It was not clear under Welfare and Institutions Code section 3200 whether "time served" included outpatient time or only confinement time, and (2) It was not clear whether "sentence" included a preparole term.
The second ambiguity was resolved by the Supreme Court in In re Grey (1974) 11 Cal.3d 554 [114 Cal. Rptr. 104, 522 P.2d 664]. The court held that the credit allowed under section 2900.5 "does not advance the parole termination date fixed by the Adult Authority so long as the credited time, plus the prison and parole time already served or to be served, does not exceed the maximum term." (Id., at p. 555.) The same principle was applicable to the credit allowed under Welfare and Institutions Code section 3200.
In 1975 Penal Code section 1203.03, subdivision (f) was amended to provide, "Time spent by a defendant in confinement in a diagnostic facility of the Department of Corrections pursuant to this section or as an outpatient or inpatient of the California Rehabilitation Center shall be credited on the term of imprisonment." (Stats. 1975, ch. 1087, § 5, p. 2650, italics added.)
Shortly thereafter the Legislature responded to In re Grey by amending Penal Code section 2900.5 to provide that "all days of custody ... shall be credited upon [a defendant's] sentence," and "sentence" was defined to include "any term of imprisonment, including any period of imprisonment prior to release on parole and any period of imprisonment *526 and parole, prior to discharge." (Pen. Code, § 2900.5, subds. (a) and (c) as amended by Stats. 1976, ch. 1045, § 2, p. 4665.)[3]
Respondent contends, and the trial court held, that the combined effect of these statutory provisions was to give respondent a "vested right" to have her time spent on outpatient status credited against her term of imprisonment and thus to her parole in fixing her discharge date. (See former Cal. Admin. Code, tit. 15, §§ 2100, 2101, 2156, 2225.)
In the trial court proceeding appellant conceded that respondent had a "vested right" to credit for her CRC outpatient time against any ISL sentence calculated for her. However, appellant contended in the trial court and argues on appeal that respondent acquired no vested right to CRC outpatient credit against her DSL term. We agree.
Simultaneously with enactment of the DSL, the Legislature amended Penal Code section 1203.03 to delete "outpatient" custody days from the time to be credited on a subsequently imposed term of imprisonment. (Stats. 1977, ch. 165, § 21, p. 655, urgency, eff. June 29, 1977, operative July 1, 1977.)[4]
Respondent contends that, although the Legislature deleted the right to outpatient credit at the time it enacted the DSL, this legislative action cannot divest her of the right to such credits, since her entitlement was established under the law applicable at the time she was on outpatient status. The trial court agreed, holding that the application of the statute to deny respondent such credits constituted an ex post facto application of the law in violation of respondent's constitutional rights.
(2) Ex post facto laws are prohibited by both the federal and state Constitutions. (U.S. Const., art. I, § 9, cl. 3; Cal. Const., art. I, § 9.) "A statute has an ex post facto effect when it alters the situation of an accused to his disadvantage by: (a) making criminal an action innocent when done; (b) making more serious an act already criminal when *527 done; (c) inflicting greater punishment than that attending the act at the time it was committed; or (d) permitting a person to be convicted with less evidence than was required when the act was done." (People v. Sobiek (1973) 30 Cal. App.3d 458, 472 [106 Cal. Rptr. 519, 82 A.L.R.3d 804], cert. den., 414 U.S. 855 [38 L.Ed.2d 104, 94 S.Ct. 155].)
It is well settled that among laws having an ex post facto effect are those which retroactively modify the time of discharge from custody to the substantial detriment of the defendant, thereby in effect increasing the punishment previously imposed for his crime. (In re Dewing (1977) 19 Cal.3d 54, 57 [136 Cal. Rptr. 708, 560 P.2d 375].)
(1b) Since at the time respondent was convicted and sentenced, applicable law did not allow CRC outpatient credit against her sentence, there has been no increase in her punishment in the normal sense. However, in In re Bray (1979) 97 Cal. App.3d 506, 509 [158 Cal. Rptr. 745], we considered the retroactive application of the parole provisions of the DSL to prisoners who committed crimes before July 1, 1977, and held that where a prisoner had acquired a vested right to a parole term of eighteen months under the DSL as initially enacted, a later statute increasing the maximum period of parole to four years had an ex post facto effect as to such prisoners.[5]
The Legislature expressly stated that the DSL was retroactive. Therefore, persons who were serving sentences under the ISL received the benefits expressly provided for in the DSL. The Community Release Board (now the Board of Prison Terms) was required to apply the DSL, as prescribed, to prisoners who committed crimes before July 1, 1977. (People v. Alcala (1977) 74 Cal. App.3d 425, 427 [141 Cal. Rptr. 442]; Pen. Code, §§ 1170.2, 2930, subd. (b), 2931, subd. (a), 3000, subd. (b), 3040, 3041.)
In In re Bray, we held that the effect of the retroactive portions of the DSL was to place ISL prisoners in a position as if the DSL were the *528 law at the time they committed their offenses. Therefore, when the DSL was subsequently amended in 1978 to increase the parole period, it had an ex post facto effect as to such prisoners.
Respondent contends that the 1977 amendment deleting credit for time on CRC outpatient status has a similar ex post facto effect as to her.
The critical difference between this case and In re Bray is that respondent never acquired a right to outpatient credit against her DSL term. Since the outpatient credit provisions were deleted effective simultaneously with the operative date of the DSL, the right to such credits never became vested against her DSL term.
No question of an ex post facto violation arises in connection with retroactive legislation when such legislation has an ameliorative effect. (People v. Superior Court (Gonzales) (1978) 78 Cal. App.3d 134, 142 [144 Cal. Rptr. 89].) As to respondent, the retroactive application of the DSL could only have an ameliorative effect.
Penal Code section 1170.2 provides in pertinent part as follows: "(a) In the case of any inmate who committed a felony prior to July 1, 1977, who would have been sentenced under Section 1170 if he had committed it after July 1, 1977, the Board of Prison Terms shall determine what the length of time of imprisonment would have been under Section 1170 without consideration of good-time credit and utilizing the middle term of the offense bearing the longest term of imprisonment of which the prisoner was convicted....[[6]] [¶] (b) 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).... [¶] *529 (c) Nothing in this section shall be deemed to keep an inmate in the custody of the Department of Corrections for a period of time longer than he would have been kept in its custody under the provisions of law applicable to him prior to July 1, 1977...."
The principle established by the above provisions is that two different term calculations are made with respect to inmates who committed their crimes prior to July 1, 1977. The first determines release date under the ISL; the second is calculated under Penal Code section 1170.2, subdivision (a). The inmate is then given the more favorable term.[7]
Presumably the DSL term prior to parole calculated for respondent is less than the ISL term. Otherwise, under Penal Code section 1170.2, respondent would have received an ISL term. The parole period prior to discharge is now fixed by statute, whereas under the ISL the parole board would set both the term prior to parole and the term prior to discharge. Respondent does not suggest that her ISL term would have been less than the DSL term even allowing for the additional outpatient credit.[8]
We conclude that the respondent's situation has not been altered to her disadvantage. To the contrary, as to her the DSL has had an ameliorative effect.
The judgment is reversed.
Gardner, P.J., and Tamura, J., concurred.
NOTES
[1]  No ISL release date has been fixed, and since the initial date for her board appearance was July 24, 1980, it is doubtful that one will ever be fixed.
[2]  The DSL became operative July 1, 1977. (Stats. 1976, ch. 1139, § 351.5, p. 5176.)
[3]  Although section 2900.5 was amended in 1978 to delete application of credits to parole dates, since such dates were not fixed in determinate sentencing, the application of credits to that portion of the term prior to release on parole was retained. The 1978 amendment also substituted "term of imprisonment" for "sentence" in subdivisions (a) and (c). (Stats. 1978, ch. 304, § 1, p. 362.)
[4]  A 1976 amendment relettered subdivision (f) to (g) (Stats. 1976, ch. 284, § 1, p. 592) and the 1977 amendment deleted "outpatient" from the renumbered subdivision (g).
[5]  The parole provisions of the DSL were amended by Statutes 1978, chapter 582, page 2002. The parole term (if there is no confinement for parole violation) was increased from one year to three years, and the maximum statutory period of parole (if there is a confinement for parole violation) was increased from eighteen months to four years. (§ 3000, Stats. 1978, ch. 582, § 1, p. 2002.) The maximum period of confinement for a parole violation was increased from six months to twelve months. (§ 3057; Stats. 1978, ch. 582, § 4, p. 2004.) These new provisions became effective on January 1, 1979.
[6]  Penal Code section 1170, subdivision (a)(2) encompasses "any case in which the punishment prescribed by statute for a person convicted of a public offense is a term of imprisonment in the state prison of 16 months, two or three years; two, three, or four years; ... or any other specification of three time periods ..."

Under Penal Code section 473, forgery (Pen. Code, § 470) is punishable by imprisonment in state prison, or by imprisonment in the county jail for not more than one year.
Penal Code section 18 provides: "Except in cases where a different punishment is prescribed by any law of this state, every offense declared to be a felony, or to be punishable by imprisonment in a state prison, is punishable by imprisonment in any of the state prisons for 16 months, or two or three years; ..."
[7]  Penal Code section 1170.2, subdivision (b) does permit deviations from this principle in certain circumstances, not here relevant, and after a hearing.
[8]  For retroactive sentencing procedures see California Administrative Code, title 15, sections 2145, 2146, 2166, 2327, 2342(c) and 2345.
