
15 Ill. App.3d 230 (1973)
304 N.E.2d 99
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
FREDERICK ARTHUR DECKER, Defendant-Appellant.
No. 73-9.
Illinois Appellate Court  Second District.
November 15, 1973.
Ralph Ruebner, Deputy Defender, of Elgin, for appellant.
*231 Gerry L. Dondanville, State's Attorney, of Geneva, (Clarence Wittenstrom, Assistant State's Attorney, of counsel,) for the People.
Judgment affirmed and cause remanded.
Mr. PRESIDING JUSTICE GUILD delivered the opinion of the court:
On the night of November 10th, 1968 the defendant, a resident of the Kelly Hotel in Elgin, while sitting in the hotel lobby noted a woman register into the hotel. Later that evening he knocked at her hotel room and disguised his voice as the maid. Upon the door being opened he threatened the victim with a knife, forced her to disrobe, attempted to rape her and then stole money from her purse. Prior to leaving her room he cut the telephone wire and threatened her.
On December 17, 1968, the defendant having been indicted for attempt rape and armed robbery, plead guilty to attempt rape and robbery.[*] On January 17, 1969, he was granted probation for a period of three years, the first thirty days to be spent in the county jail in Kane County commencing January 17, 1969. He was allowed to go to Erie, Pennsylvania, to serve the term of his probation. During his probationary stay in Pennsylvania, he was arrested for an assault upon a six year old child, was incarcerated from April 27, 1970 to September 16, 1970, when the charge was nolle prossed because the child was unable to testify. On July 6, 1971, he was again arrested for an assault upon another six year old child in which he tied her hands and feet, tied a scarf around her neck which had been soaked in solvent which burned her face, and then put her in a closet. This time he was sentenced by the Pennsylvania court for a 1-2 year term upon a plea of guilty to assault and battery.
On November 30, 1971, the Illinois court entered a temporary order of revocation of his probation. On August 10, 1972, the defendant was returned to Illinois. On September 7, 1972, probation was revoked and the defendant was sentenced to the Illinois State Penitentiary for a period of 2-4 years.
 1 Since the date of defendant's sentence, the Unified Code of Corrections has become effective. There is no question that the sentencing provisions of the new Code are applicable to cases now on appeal if the sentences under the Code are less than under the prior law. Such is the fact here. People v. Harvey (1973), 53 Ill.2d 585, 294 N.E.2d 269.
*232 Having the benefit of the Code's sentencing provisions, defendant contends that he is entitled to credit against his sentences of imprisonment for the time served on probation until November 30, 1971 when probation was temporarily revoked. In support of his contention for this amount of credit, defendant cites section 5-6-4(h) of the Unified Code (Ill. Rev. Stat., 1972 Supp., ch. 38, par. 1005-6-4(h)):
"Resentencing after revocation of probation or of conditional discharge shall be under Article 4. Time served on probation or conditional discharge shall be credited against a sentence of imprisonment or periodic imprisonment." (Emphasis added.)
The State contends that the phrase "Time served on probation" refers to time served in custody. We do not agree. The language contained in the second sentence of section 5-6-4(h) of the Code is certain and unambiguous and does not warrant an interpretation obviously not clearly stated by the legislature. "Time served on probation" means just that. It is true as contended by the State that in certain instances this section of the Unified Code will lead to somewhat absurd results. As the State points out, a defendant placed on probation for a period of five years for a class 4 felony could not be sentenced for a violation thereof during the last two years of his probation, as the maximum term of his sentence shall not exceed three years, and if he has been on probation for three years no sentence could be imposed for any violation committed thereafter. Nonetheless, we must reluctantly hold that the legislature did not intend this provision of the statute to apply only to time "in custody" or "in confinement."
Having decided that the sentence crediting provision of section 5-6-4(h) of the Unified Code of Corrections relative to time served on probation is applicable, the question remains as to the amount of time to which defendant is entitled.
Counsel for defendant contends defendant should be credited for all the period, approximately 33 1/2 months, from the time he was released in Illinois on probation, to the time his probation was temporarily revoked on November 30, 1971, including 9 1/2 months spent in jail in Pennsylvania. Defendant was sentenced for a term of 2-4 years after violation of probation because of a conviction of another crime during that period of probation. As contended by defendant, under the crediting section of the Unified Code, not only would defendant have served his two year minimum sentence as of the date of that sentence, but would be entitled to almost a year additional credit.
 2-4 There is no question, under either the present or former laws, that defendant is entitled to credit against his sentences of imprisonment for the time he was returned to custody from August 10, 1972 to September *233 7, 1972 in the Kane County jail prior to the actual imposition of the prison sentence in Illinois. (Ill. Rev. Stat., 1972 Supp., ch. 38, par. 1005-8-7 (b), and Ill. Rev. Stat. 1971, ch. 38, par. 119-3.) Defendant is also entitled to credit, pursuant to section 5-6-4 (h) of the Code, for that period of his probation term in Pennsylvania, from February 17, 1969 to July 6, 1971, and for the first thirty days served under the terms of his probation in the Kane County jail. We do not, however, agree with the defendant's contention that he is entitled to credit against his term of imprisonment for the period of time he spent in jail in Pennsylvania for the conviction of assault upon the six year old girl, before his probation was temporarily revoked. Clearly, while defendant was in custody in Pennsylvania for the charge brought against him there resulting in his conviction, he was not serving time on the term of probation imposed upon him by Illinois. Therefore, defendant is not entitled to any credit against his sentence of imprisonment for this second period he spent in jail in Pennsylvania.
The purpose and ultimate aim of probation is to provide a period of grace in order to aid the rehabilitation of a repentant offender, thus benefiting the general public by making the offender a useful member of society. As stated in People v. Henderson (1971), 2 Ill. App.3d 401, 405, 276 N.E.2d 372:
"The basic theory of probation is to grant defendant an opportunity of rehabilitation without incarceration; to afford the unfortunate another opportunity by extending clemency."
Or, as the court stated in People v. Donovan (1941), 376 Ill. 602, 607, 35 N.E.2d 54, probation is thus an act of grace or a grant of mercy for "the protection of society and the reform of the defendant."
In the instant case the opportunity afforded defendant for rehabilitation and reform was to no avail.
To further complicate an incongruous situation, while not raised by the defendant, we must nonetheless consider the further lessening of the court's sentence by virtue of the provisions of section 5-8-1 wherein we find the penalties for robbery, which is a class 2 felony (Ill. Rev. Stat., 1972 Supp., ch. 38, par. 18-1), and attempt rape, which is a class 3 felony (Ill. Rev. Stat., 1972 Supp., ch. 38, par. 8-4(c) (3)). In both of these offenses the minimum penalty pursuant to the Unified Code may not exceed one-third of the maximum sentence imposed. In this case the maximum sentence imposed was four years. The minimum sentence that may be imposed is one year four months. People v. Harvey, 53 Ill.2d 585, 294 N.E.2d 269.
 5 Since this cause has not been finally adjudicated as of the effective date of the Unified Code of Corrections, the defendant is entitled to the *234 benefit of its provisions which would lessen his minimum sentence. We affirm the judgment of the trial court and remand the cause to the Circuit Court of Kane County for proper resentencing and crediting in conformity with the opinion expressed herein. The Circuit Court of Kane County is further directed to issue a corrected mittimus in conformity with the sentence imposed. See Harvey, supra.
Remanded with directions.
T. MORAN, J., concurs.
Mr. JUSTICE SEIDENFELD dissenting in part:
The majority concludes that the defendant is not entitled to credit for the 4 months and 25 days served in Pennsylvania on a conviction for another offense, prior to the filing of the petition to revoke in Illinois. To this extent I disagree, for in my view, this conclusion engrafts an exception which is inconsistent with the very interpretation which the majority places on the statute.
The opinion states that "`Time served on probation' means just that." And, although the majority opinion recognizes that the interpretation may lead to absurd results when applied during the latter part of a probation period in certain instances, it is constrained from denying the plain meaning of the words used. The same considerations would apply to the credit which the majority opinion denies. Defendant was still on probation for the Illinois offense until the filing of the revocation petition in Illinois. (See Ill. Rev. Stat. 1971, ch. 38, par. 117-3(a).) The only obvious meaning of the statutory language in question is one that computes "time served on probation" from the time it begins until the time it is tolled according to statute or until probation is revoked. See Ill. Rev. Stat., 1972 Supp., ch. 38, par. 1005-6-4 (a).
If the statutory language is to be interpreted so as to avoid absurd results it is not logical just to single out time spent in jail involving a conviction for a different crime. If a qualitative analysis of the probation credit may be made under the statute, credit, for example, should also be denied for time spent in jail for any reason which leads to revocation regardless of conviction; or even any time not spent in custody after a violation of probation but before temporary revocation, whatever the violation may be.
NOTES
[*]   It is to be noted that the briefs of both the appellant and the State allege that the defendant pleaded and was found guilty of "armed robbery." That is not correct. On December 19, 1968 the defendant pleaded guilty to attempt rape and robbery and the order of the court reads as follows:

"* * * and having pleaded guilty to the offense of robbery, being a lesser included offense in armed robbery charged in Count II of the indictment * * *."
