
39 Ill. App.3d 757 (1976)
350 N.E.2d 583
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
JERRY PEACH, Defendant-Appellant.
No. 75-278.
Illinois Appellate Court  Third District.
Opinion filed June 30, 1976.
*758 William E. Stewart, of Kewanee, for appellant.
William K. O'Connor, State's Attorney, of Cambridge, for the People.
Judgment affirmed and cause remanded.
Mr. JUSTICE BARRY delivered the opinion of the court:
Defendant, Jerry Peach, pled guilty to a charge of burglary in the Circuit Court of Henry County and was sentenced on May 23, 1972, to three years' probation, to make restitution and to spend the first 90 days in the county jail. On April 18, 1975, a petition was filed by the State requiring defendant to show cause why his probation should not be revoked. A hearing on the petition was held on April 25, 1975, and subsequently his probation was revoked. The court then sentenced him to the Department of Corrections for a period of not less than three years nor more than ten years plus three years' mandatory parole. The court further ordered that the time defendant had already served on probation was not to be credited upon the term of imprisonment.
The revocation of defendant's probation was based upon the allegation that he had committed the offense of contributing to the sexual delinquency of a minor while on probation. The record of the hearing shows an adequate factual basis to support revoking Peach's probation.
He complains on appeal that in the sentence imposed for burglary after his probation was revoked he was not given credit for time served on probation and time actually spent in custody.
The State argues that the trial court could within its discretion refuse to allow defendant credit for time served on probation. People v. Johnson, *759 25 Ill. App.3d 503, 323 N.E.2d 539 (1975). The statute involved is section 5-6-4(h) of the Unified Code of Corrections (Ill. Rev. Stat. 1973, ch. 38, par. 1005-6-4(h)) which provides: "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.) That section of the statute became effective on January 1, 1973, while defendant was on probation. Subsequent to defendant's sentence of probation and before probation was revoked said statute was amended by Public Act 78-939 (Ill. Rev. Stat. 1973, ch. 38, par. 1005-6-4(h)), to read: "Resentencing after revocation of probation or of conditional discharge shall be under Article 4. Time served on probation or conditional discharge shall be credited by the court against a sentence of imprisonment or periodic imprisonment unless the court orders otherwise." (Emphasis added.) The amendment permitted judicial discretion in the matter and became effective July 1, 1974. People v. Robinson, 20 Ill. App.3d 152, 313 N.E.2d 213 (1974).
 1 It is defendant's contention that section 5-6-4(h) of the Unified Code of Corrections (Ill. Rev. Stat. 1973, ch. 38, par. 1005-6-4(h)) as amended is unconstitutional as applied to him because it is an ex post facto law. Both the constitutions of the United States and Illinois contain prohibitions against ex post facto laws. Under the generally accepted notions regarding ex post facto laws, a statutory enactment would be constitutionally infirm if it increased the punishment for a crime committed prior to the effective date of the statute. In deciding whether the trial court erred in refusing to give defendant credit for time served while sentenced to probation we must necessarily consider whether the trial court applied this statute to the defendant in an unconstitutional manner.
We have been cited to several cases referring generally to the subject matter of credit on a sentence for time served on probation. In all these cases probation was revoked prior to the effective date of the discretionary amendment of section 5-6-4(h) (Ill. Rev. Stat., ch. 38, par. 1005-6-4(h)) by Public Act 78-939. In People v. Haak, 26 Ill. App.3d 1031, 325 N.E.2d 423 (1975), and in People v. Houston, 27 Ill. App.3d 834, 327 N.E.2d 314 (1975), the court held that the provisions of the Unified Code of Corrections as originally enacted was effective on the date probation was revoked and the sentence was imposed because the mandatory credit provisions controlled the case.
The issue of the ex post facto application of the amendment and its constitutionality has not been adjudicated by the Illinois courts. Several opinions have indicated by way of dicta that the amendment to section 5-6-4(h) was constitutional. The court in People v. Houston stated, *760 "Had Public Act 78-939 been effective on the date the defendant's probation was revoked and sentence imposed, the order of the court [here] would preclude the defendant from any additional credit for time served on probation." (27 Ill. App.3d 834, 837, 327 N.E.2d 314, 316.) In that case defendant Houston's probation was revoked prior to July 1, 1974, the effective date of the amendment. Defendant Peach's probation was revoked after July 1, 1974, and the amended section of the Unified Code of Correction granting the trial judge the discretion to give credit for time served on probation is directly applicable.
In People v. Johnson, the court held that the amended section applied to a judgment that was not finally adjudicated because it was pending on appeal and ordered the cause to be remanded for the trial court to determine the amount of time spent on probation to be credited on defendant Johnson's sentence "* * * unless it orders otherwise * * *." 25 Ill. App.3d 503, 506, 323 N.E.2d 533, 541.
The Unified Code of Corrections provides that probation is a sentence. (See People v. Boucher, 57 Ill.2d 225, 311 N.E.2d 679 (1974).) The sentencing provisions of the Code apply to cases pending on direct appeal if the Code prescribes a lesser penalty. Ill. Rev. Stat. 1975, ch. 38, par. 1008-2-4; People v. Harvey, 53 Ill.2d 585, 590, 294 N.E.2d 269 (1973).
 2 We believe the comments of the appellate court in People v. Taylor, 21 Ill. App.3d 702, 315 N.E.2d 914 (1974), express the better view. In that case the amendment involved here was not effective at the time the defendant's probation was revoked, but the court stated of the amendment, "Moreover, even if it were effective, this amendment could not be applied here because such application would violate the constitutional prohibition against ex post facto laws." (Emphasis added.) (21 Ill. App.3d 702, 704, 315 N.E.2d 914, 916.) As applied to the case at bar, the amendment increases the punishment Peach received for the offense of burglary by failing to give him credit for time served on probation. "It is clear that punishment for the offense cannot be increased by an amendatory act taking effect after the offense has been committed within the constitutional prohibition against ex post facto laws." (People v. Wyckoff, 106 Ill. App.2d 360, 364, 245 N.E.2d 316, 318 (1969).) The failure of the trial court to give credit to defendant for time served on probation was erroneous and unconstitutional as applied to him. (See Lindsey v. Washington, 301 U.S. 397, 81 L.Ed. 1182, 57 S.Ct. 797 (1937).) Further we conclude the legislature, in amending this statute and allowing judicial discretion with regard to resentencing after probation has been revoked, clearly intended that its amended statute be constitutional and not an ex post facto expression, and therefore that it apply only prospectively and only to probation orders entered after its *761 effective date (July 1, 1974). There is a distinct difference between an order of probation entered prior to July 1, 1974, sentencing defendant to a term of probation which is revoked after July 1, 1974, and a new order sentencing to a term of probation entered after July 1, 1974. In the former case we find it impossible for the trial court to apply the amended statute without increasing the term of defendant's sentence for a crime committed years earlier.
 3 We find no merit in defendant's claim that the sentence imposed was excessive. His sentence was within the statutory framework for the offense charged.
The issue of whether defendant's sentence was invalid because no order revoking probation and no order of judgment of sentence was entered of record need not be decided. The oral orders of the trial court revoking defendant's probation and sentencing him evidenced by docket entries to the same effect may be corrected upon remand by appropriate orders nunc pro tunc. People v. Glenn, 25 Ill.2d 82, 182 N.E.2d 670 (1962); People v. Cobb, 343 Ill. 78, 174 N.E. 885 (1931).
The judgment of conviction of the Circuit Court of Henry County is affirmed; the cause is remanded to the Circuit Court of Henry County and that court is directed to issue an amended mittimus reflecting credit for time actually spent in custody, both before his plea and after finding of violation of probation, and for time actually served on probation on his sentence for the offense of burglary.
Affirmed and remanded with directions.
STOUDER, P.J., concurs.
Mr. JUSTICE ALLOY, specially concurring:
I believe that the provisions of section 5-6-4(h) of the Unified Code of Corrections (Ill. Rev. Stat. 1973, ch. 38, par. 1005-6-4(h)) should only be construed prospectively.
The trial court erroneously applied this section in considering sentencing of defendant Peach.
Since the amendment with which we are concerned in this case increases the punishment for an offense as compared with the existing provision, that amendment would be unconstitutional for such reason. (People v. Taylor (1974), 21 Ill. App.3d 702, 315 N.E.2d 914; People v. McKinney (1968), 40 Ill.2d 372, 240 N.E.2d 577.) Laws which increase the punishment for acts already committed, when such laws are enacted following the commission of the act, are deemed to be ex post facto and void (People ex rel. Dyer v. Walsh (1931), 346 Ill. 52, 178 N.E. 343).
In the case which we have under consideration, defendant Peach was sentenced in May of 1972. At that time, there was no provision that *762 probation must be credited as against sentence and, as a matter of fact, it was not until January 1, 1973, that such probation credit was expressly provided to be given by statute and such provision was not amended until July 1, 1974, at the time the court was given discretion to deny such credit, in the amendment which we are now considering.
I believe that the amendment which was enacted effective July 1, 1974, should be construed as having prospective application only and to apply only to crimes committed after July 1, 1974, the effective date of the Act. We should, in our construction, conclude that the legislature did not intend to enact an ex post facto law and, therefore, that the discretionary right to deny probation credit which was vested in the trial court was intended to be applicable only after July 1, 1974. If we adopt such construction we avoid a determination of unconstitutionality. The consequence would be that the court could not apply the discretionary power to deny the credit as against time served.
The trial court was under the misapprehension that the amendment was in force and could be applied by the court retroactively. The amendment was, therefore, improperly applied and the sentence should be reversed and the cause remanded for resentencing in accordance with such views.
