
128 Ariz. 56 (1980)
623 P.2d 845
STATE of Arizona, Respondent,
v.
Terrance Frank SEIP, Petitioner.
No. 1 CA-CR 4856-PR.
Court of Appeals of Arizona, Division No. 1, Department B.
December 16, 1980.
Rehearing Denied January 27, 1981.
Review Denied February 11, 1981.
*57 Charles F. Hyder, Maricopa County Atty. by Joseph Brownlee, Deputy County Atty., Phoenix, for respondent.
Ross P. Lee, Maricopa County Public Defender by Anne Kappes, Deputy Public Defender, Phoenix, for petitioner.
OPINION
EUBANK, Judge.
Petitioner pled guilty to first degree burglary on March 8, 1977, and was placed on probation for four years on April 4, 1977. He was incarcerated in the Maricopa County Jail for 76 days from the date of his arrest on January 18, 1977 through April 4, 1977, and, he served 10 months in the Maricopa County Jail as a condition of his probation. His probation was revoked on September 1, 1978, and the trial court sentenced him to serve not less than 3 nor more than 7 1/2 years in the Arizona State Prison, said sentence to commence July 19, 1978, with credit for 45 days jail time spent in custody waiting for disposition of the petition to revoke probation. At sentencing the trial court did not allow credit for 76 days pre-probationary incarceration or for 10 months incarceration as a condition of probation.
Petitioner filed a Rule 32 Petition for Post Conviction Relief claiming: (1) that he is entitled to credit for all time spent in custody as a condition of probation pursuant to A.R.S. § 13-903(E), and that he is entitled to credit for all time spent in custody prior to the imposition of probation pursuant to A.R.S. § 13-709(B), (2) that A.R.S. § 13-903(E) and A.R.S. § 13-709(B) must be applied retroactively, and (3) that prospective application only of A.R.S. § 13-903(E) and § 13-709(B) discriminates against persons whose offenses were committed prior to October 1, 1978, and violates the due process and equal protection clauses of the constitution. The trial court denied the petition for post-conviction relief and the motion for rehearing. A timely petition for review was filed, and this appeal presents the issues enumerated above.
For the following reasons, we deny relief. Turning to the first issue that petitioner is entitled to a credit for all time served, A.R.S. § 13-903(E) provides:
Time spent in custody under section 13-901, subsection E shall be credited to any sentence of imprisonment imposed upon revocation of probation.
Petitioner claims pursuant to this statute that he is entitled to credit for the 10 months he spent in the Maricopa County Jail as a condition of his probation. A.R.S. § 13-709(B) provides:
All time actually spent in custody pursuant to an offense until the prisoner is sentenced to imprisonment for such offense shall be credited against the term of imprisonment otherwise provided for by this chapter.
Petitioner argues that pursuant to this statute, he is entitled to credit for 76 days jail time. We disagree.
A.R.S. §§ 13-903(E) and 709(B) are part of the new comprehensive criminal code which became effective on October 1, 1978.[1] Section 179(c), Chapter 142, Laws 1977 of the new criminal code provides:
The provisions of this act do not apply to or govern the construction of and punishment for any offense committed before the effective date of this act, or the construction and application of any defense *58 to a prosecution for such an offense. Such an offense must be construed and punished according to the provisions of law existing at the time of the commission thereof in the same manner as if this act had not been enacted.
Therefore, the legislature has expressly directed that the new criminal code shall operate prospectively only. See also State v. Scrivner, 125 Ariz. 508, 611 P.2d 95 (App. 1979); State v. Brown, 123 Ariz. 406, 599 P.2d 859 (App. 1979).
In addition, A.R.S. § 1-246 provides that when a penalty for an offense is altered by a subsequent law, the subsequent change shall not be imposed for an offense committed prior to the enactment of the subsequent law, and that the offender shall be punished under the prior law which was in effect when the offense was committed. Further, A.R.S. § 1-244 provides that no statute is retroactive unless expressly declared therein. The legislature has not expressly declared that the statutes be given retroactive application. Thus, neither A.R.S. § 13-903(E) nor § 13-709(B) was intended by the legislature to supersede the law in effect at the time petitioner's probation was revoked, and the statutes are not applicable to petitioner's situation. We hold that at the time petitioner was sentenced, he was not entitled to credit for time spent in county jail pursuant to a condition of probation following a revocation of that probation. State v. Fuentes, 26 Ariz. App. 444, 549 P.2d 224 (1976), affirmed, 113 Ariz. 285, 551 P.2d 554 (1976); State v. Layman, 117 Ariz. 509, 573 P.2d 909 (1977); Annot. 77 A.L.R.3d 182, 241.
Petitioner next asserts that if A.R.S. § 13-709(B) and § 13-903(E) do not supersede the law in effect at the time he was sentenced, the enactment of such statutes as prospective only violate the equal protection clause of the United States Constitution. He contends that the enactment creates an arbitrary distinction which discriminates against persons sentenced for offenses committed prior to the effective date of the statutes. He argues that all prisoners have an equal right to credit for time served irrespective of whether they were sentenced before or after the enactment of the statute. He relies primarily on In Re Kapperman, 114 Cal. Rptr. 97, 522 P.2d 657 (1974). We disagree.
As the dissent in Kapperman points out, federal courts have held that it is not a denial of equal protection to confer a benefit on prisoners prospectively only. Jones v. Cupp, 452 F.2d 1091 (9th Cir.1971); Comerford v. Commonwealth, 233 F.2d 294 (1st Cir.1956). In Jackson v. Alabama, 530 F.2d 1231 (5th Cir.1976), the court noted that presentence credit "is not an absolute constitutional right," and that an Alabama statute authorizing presentence credit "simply confers a benefit, not previously provided, on state prisoners sentenced after March 10, 1975." 530 F.2d at 1238. The court correctly pointed out that all ameliorative legislation which goes into effect at a certain date produces such a result, and held that the statute did not deny equal protection to prisoners sentenced prior to the effective date of the act.
In Arizona, for purposes of determining whether a law violates equal protection, we must consider the character of the classification, the individual interests affected by the classification, and the government interest asserted in support of the classification. State v. Kelly, 111 Ariz. 181, 526 P.2d 720 (1974). The state possesses the power to treat different classes of persons in different ways if the classification is reasonable and is supported by a rational and legitimate state interest. State v. Bly, footnote 1; State v. Kelly, supra.
In the instant case, we believe that the difference in the treatment of prisoners sentenced under the old code from prisoners sentenced under the new code is reasonable. Trial judges sentencing persons under the old code considered the law in effect at the time to determine the most appropriate punishment for the offender in light of the nature of the offense and the moral character and past conduct of the offender. Such sentences were imposed with regard to the four objectives to be obtained by a particular sentence: retribution, restraint, deterrence *59 and rehabilitation. State v. O'Neill, 117 Ariz. 343, 572 P.2d 1181 (1978).
We hold that the prospective application of A.R.S. §§ 13-903(E) and 709(B) maintains the fourfold objectives of the punishments imposed on prisoners sentenced for offenses committed prior to the effective date of the act, and that the maintenance of those objectives constitutes a rational, reasonable and legitimate state interest. Therefore, we conclude that the petitioner's equal protection claim is without substance.
For the foregoing reasons, review is granted and relief is denied.
HAIRE, P.J., and JACOBSON, J., concur.
NOTES
[1]  For a comprehensive discussion of the legislative intent regarding the sentencing options under the new Criminal Code, see State v. Bly, Ariz., 621 P.2d 279 (1980).
