
574 N.E.2d 1337 (1991)
215 Ill. App.3d 533
158 Ill.Dec. 944
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
John A. HUTCHCRAFT, Defendant-Appellant.
No. 4-90-0253.
Appellate Court of Illinois, Fourth District.
June 28, 1991.
Daniel D. Yuhas, Deputy Defender, Gloria Ann Morris, Asst. Defender, Office of State Appellate Defender, Springfield, for defendant-appellant.
Kenneth R. Boyle, Director, State's Attys. Appellate Prosecutor, Robert J. Biderman, Deputy Director, Springfield, for plaintiff-appellee.
Justice McCULLOUGH delivered the opinion of the court:
On revocation of probation, defendant was sentenced to three years' imprisonment for burglary (Ill.Rev.Stat.1985, ch. 38, par. 19-1(a)), with credit for 149 days served. On appeal, defendant argues he is entitled to additional sentence credit (Ill. Rev.Stat.1989, ch. 38, par. 1005-8-7(b)), and requests remand to the trial court for recalculation of the credit he is due. He maintains he served at least 263 days prior to the date of sentencing on revocation, including time served for contempt of court.
At the outset, we note that the presentence report prepared in this cause stated defendant had spent 118 days in custody in connection with this case. The probation officer's testimony at sentencing on April 5, 1990, as transcribed in the record on appeal, uses the figure 180 days, though no correction to the presentence report was made. At the conclusion of the sentencing hearing, the judge directed the special prosecutor and defense counsel to "figure up" the amount of sentence credit defendant should receive, stating that if there was a dispute, he would resolve it. The written judgment order credited defendant with 149 days. As this court stated in People v. Compton (1990), 193 Ill.App.3d 896, 904, 140 Ill.Dec. 755, 760, 550 N.E.2d 640, 645, if a defendant is held in custody for any part of a day, he is entitled to credit against his sentence for that day; i.e., in counting *1338 days for purposes of sentence credit under section 5-8-7(b) of the Unified Code of Corrections (Unified Code) (Ill.Rev.Stat. 1989, ch. 38, par. 1005-8-7(b)), both the first and last days are counted.

I. TIME SERVED IN MAY 1986, AT TIME OF ARREST
On May 5, 1986, defendant was charged by information in this cause, Logan County case No. 86-CF-28, with the burglary of Adams School, in Lincoln, Illinois. Defendant maintains he was arrested on May 5, 1986, although the record does not definitively show the date of arrest; the bail bond form shows bond was received on May 12, and the form was filed in the circuit clerk's office and a receipt voucher issued on May 13, 1986. Accordingly, as the first matter on remand, should the court find that defendant was in fact arrested on May 5, given his release on bond on May 12, 1986, he would have been incarcerated for some portion of eight days, and is therefore entitled to eight days' sentence credit; if arrested on another date, he should be credited accordingly.

II. TIME SERVED AS A CONDITION OF PROBATION
Defendant pleaded guilty to the offense in December 1986. On January 26, 1987, he was sentenced to 30 months' probation, including a condition that he serve 180 days' incarceration in the county jail commencing at 6 p.m. that day. Defendant now contends he should be credited 180 days for this period. Had he served the entire 180-day term, he would have been released on July 24, 1987, and he would be entitled to such credit. It appears, however, that he was released early, since on June 2, 1987, the State filed a petition to revoke defendant's probation or in the alternative to hold him in contempt, alleging that on May 31, 1987, he committed the offense of unlawful consumption of alcohol by a minor (Ill.Rev.Stat.1985, ch. 43, par. 134a). Defendant is not entitled to 180 days' credit if he did not serve the full 180 days because of credit for time served. He would receive double credit to rule otherwise. Therefore, as the second item on remand, the parties may present evidence to show the date of defendant's release from incarceration served as a condition of his probation, and sentence credit shall be calculated to include both the first and last day of incarceration, consistent with Compton. See People v. Scheib (1979), 76 Ill.2d 244, 251-54, 28 Ill.Dec. 513, 516-17, 390 N.E.2d 872, 875-76 (under section 5-8-7(b) of the Unified Code (Ill.Rev.Stat.1975, ch. 38, par. 1005-8-7(b)), a defendant must be fully credited for any time spent in jail for a particular offense regardless of whether the time in confinement was considered served as part of a condition of probation; and he should be credited under section 5-8-7(b) the same as a defendant who spent time in jail prior to trial because of inability to furnish bail).

III. IF ARRESTED ON JUNE 1987 PETITION TO REVOKE
Defendant appeared in court on June 2, 1987, and was given a copy of the petition to revoke or alternatively to hold him in contempt, and his bond was set. The bail bond form shows bond was made that same day, though the form was filed in the office of the circuit clerk and noted on the docket sheet on June 3, 1987. As defense counsel notes, the record does not show defendant was arrested on the petition to revoke. Hence, as the third matter to be considered on remand, if it is determined that defendant was arrested and taken into custody on the petition to revoke filed June 2, 1987, he should be credited accordingly. On June 24, 1987, the court entered a written contempt order sentencing him to 40 hours public service.
IV. OCTOBER 1987 AND NOVEMBER 1988 CONTEMPT ORDERS
On August 4, 1987, the State filed another petition to revoke probation, or in the alternative to hold defendant in contempt, based on defendant's failure to perform 40 hours' public service work for contempt.
At hearing on October 1, 1987, the circuit court found defendant in wilful contempt *1339 of court based on the August 1987 petition, and entered a written order of judgment and sentence thereon, sentencing him to a term of four days' periodic imprisonment in the Logan County jail, to commence running on October 5, 1987, at 2:30 p.m. through October 9, 1987, at 7:30 a.m., with daily release from 7:30 a.m. to 2:30 p.m. Defendant now claims he is entitled to five days' sentence credit herein for these days served for contempt of court.
On August 19, 1988, the State filed yet another petition to revoke defendant's probation or in the alternative to hold him in contempt, alleging defendant had wilfully failed to report to the probation officer for the months of April, May, June, and July 1988, and had further wilfully failed to advise the probation office of his current address, all in violation of the conditions of his probation. The entry on the docket sheet shows that at the hearing on November 4, 1988, defendant was found in wilful contempt of court and was sentenced to 10 weekends of periodic imprisonment in the Logan County jail beginning Friday, November 11, 1988; the order of periodic imprisonment filed that date stated, however, that defendant had been adjudged guilty of violating probation and sentenced him to 10 weekends' periodic imprisonment beginning at 6 p.m. that date, with release on Sunday, November 13, 1988, at 6 p.m., and continuing for the following nine weekends.
As the orders were periodic imprisonment, if defendant is entitled to credit in this cause for this time served for contempt of court, he is entitled to credit on the basis of "the duration of its term rather than upon the basis of the actual days spent in confinement." Ill.Rev.Stat.1989, ch. 38, par. 1005-7-1(d); see also Ill.Rev.Stat.1989, ch. 38, par. 1005-7-2(c); Scheib, 76 Ill.2d at 254-55, 28 Ill.Dec. at 517-18, 390 N.E.2d at 876-77.
As to whether defendant is entitled to credit toward his burglary sentence for time served on contempt, no decisions have been cited to us on this point, only defendant's claim of entitlement to sentence credit.
We find only two cases wherein this court has addressed sentence credit for time served on contempt in the context of claims of entitlement to sentence credit under section 5-8-7(b) of the Unified Code. In People v. Sanders (1983), 115 Ill.App.3d 364, 71 Ill.Dec. 208, 450 N.E.2d 896, appeal denied (1983), 96 Ill.2d 548, this court stated the following:
"Defendant argues that under section 5-8-7 of the [Code] he is entitled to the credit for the entire amount of time served in the county jail before he pleaded guilty on these charges. He contends that while serving time on the contempt sentence, he was simultaneously in custody on the pending forgery and the residential burglary charges. The effect of simultaneous contempt commitment has not previously been addressed in Illinois decisions, but the Federal courts of appeal have adopted a rule permitting a finding of civil contempt to interrupt a criminal sentence. The State suggests that the rationale for that rule is applicable here.
* * * * * *
We find that defendant is not entitled to credit for the time served on the contempt sentence. This result is consistent with, rather than contrary to, section 5-8-7." (Sanders, 115 Ill.App.3d at 366-67, 71 Ill.Dec. at 209-10, 450 N.E.2d at 897-98.)
Four days later in People v. Brents (1983), 115 Ill.App.3d 717, 71 Ill.Dec. 222, 450 N.E.2d 910, appeal denied (1983), 96 Ill.2d 542, this court determined the issue of whether defendant was entitled to sentence credit in connection with his armed robbery sentence for time served for direct criminal contempt of court, imposed as a result of defendant's unruly conduct in court at a preliminary hearing on the armed robbery charge. There, the sentencing court refused to grant credit for the four-month period of jail time served in connection with the contempt. The Brents court affirmed, reasoning as follows:
"The question before us, then, is whether jail time served concurrently as a result of the charged offense and a subsequent *1340 criminal contempt sentence need be credited towards the sentence imposed on the first offense. We think not.
As a general rule, the defendant does not have a fundamental right to credit for time spent in custody prior to sentencing. The effect of section 5-8-7(b) is to abrogate the general rule by legislatively granting credit for in-custody time under certain conditions. The justification for the enactment is obvious in a case such as this wherein the defendant's financial inability to make bail on the charged offense is the reason for his preconviction incarceration. In our opinion, this section of the statute does not mandate crediting of jail time where preconviction incarceration is also the result of a sentencing determination on a contempt-of-court citation. This is so even though the occasion of the defendant's court appearance resulted from the criminal charge for which he was originally held in custody awaiting trial.
Federal courts, addressing the question before us with respect to analogous civil contempt situations, have consistently ruled that the trial judge has discretionary authority to give credit or not as justice requires under the circumstances. [Citations.] These well-reasoned cases provide ample grounds for holding that the matter of crediting or not the four-month period in question is best left to the sound discretion of the trial court." Brents, 115 Ill.App.3d at 720-21, 71 Ill. Dec. at 225, 450 N.E.2d at 913.
Section 5-8-7(b) of the Unified Code provides "[t]he offender shall be given credit * * * for time spent in custody as a result of the offense for which the sentence was imposed. * * *." (Emphasis added.) (Ill. Rev.Stat.1989, ch. 38, par. 1005-8-7(b).) "Offense" is defined in the Criminal Code of 1961 (Code) and the Unified Code (Ill. Rev.Stat.1989, ch. 38, pars. 2-12, XXXX-X-XX). Section 2-12 of the Code states "`Offense' means a violation of any penal statute of this State." Section 5-1-15 of the Unified Code defines "`Offense' [as] conduct for which a sentence to a term of imprisonment * * * is provided by any law of this State * * *." (Ill.Rev.Stat.1989, ch. 38, par. XXXX-X-XX.) Applying the definition of "offense" as set out in the Unified Code to the credit-for-time-served provision in section 5-8-7(b) of the Unified Code makes it clear that any order for incarceration entered, whether it be revocation, modification, or contempt, defendant is entitled to credit for time served.
In the instant case, we have a situation which is factually distinguishable from Sanders, wherein the civil contempt was for refusing to submit handwriting exemplars as ordered by the court, with one of the charges for which the defendant had been arrested being forgery; Brents, wherein the defendant became unruly in court when appearing on the armed robbery charge; and Anglin v. Johnston (7th Cir.1974), 504 F.2d 1165, wherein the defendant refused to answer the questions of a State grand jury. Here, the probation department filed forms denominated "Petition to revoke probation, conditional discharge or court supervision, or in the alternative to hold the defendant in contempt."
Regardless of whether the sentence was imposed for contempt or violating probation, the result is the same. As stated heretofore, the five days' periodic imprisonment (October 1, 1987) and the 10 weeks of periodic imprisonment (November 4, 1988) were for time served as a result of the offense.
With respect to the November 1988 order, defendant contends he should be granted sentence credit on the basis of the duration of this term of periodic imprisonment, rather than credit only for days spent in jail, relying on statutory provisions (Ill.Rev.Stat.1989, ch. 38, pars. 1005-7-1(d), 1005-7-2(c)) and Scheib, 76 Ill.2d at 254-55, 28 Ill.Dec. at 517-18, 390 N.E.2d at 876-77. Counting from November 11, 1988, through and including the last day of 10 weekends of imprisonment, January 15, 1989, would amount to 66 days. The defendant is to be credited for 66 days, i.e., the duration of the term, rather than the actual number of days spent in confinement. For the same reasons, he is entitled to five days' sentence *1341 credit for the duration of the term based on the October order.

V. MAY 1989 ARREST ON PETITION TO REVOKE
A final petition to revoke probation, or in the alternative to hold defendant in contempt, was filed on May 11, 1989, alleging that on April 2, 1989, defendant committed the offenses of driving while license suspended and driving under the influence of intoxicating liquor (Ill.Rev.Stat.1987, ch. 95½, pars. 6-303, 11-501). A warrant for defendant's arrest issued May 12 and was executed on May 15, 1989. Defendant posted bond on May 19, 1989, entitling him to five days' sentence credit on remand.

CONCLUSION
The judgment of the circuit court of Logan County is affirmed, and cause remanded with directions to take such additional evidence as necessary to determine the sentence credit to which defendant is entitled for time served in this cause, and credit his sentence accordingly: (1) from defendant's date of arrest in May 1986 to and including his release on bond on May 12, 1986; (2) from January 26, 1987, to and including the date of his release from incarceration imposed as a condition of probation; (3) if defendant was arrested and taken into custody on the petition to revoke filed June 2, 1987, from the date he was taken into custody to and including his release on bond on June 2, 1987; (4) five days' sentence credit for periodic imprisonment served pursuant to the October 1987 order; (5) 66 days' sentence credit for periodic imprisonment served pursuant to the order of November 1988; and (6) five days' sentence credit for time served in May 1989.
Affirmed and remanded with directions.
GREEN and STEIGMANN, JJ., concur.
