(730 ILCS 5/5-4.5-100)
    Sec. 5-4.5-100. CALCULATION OF TERM OF IMPRISONMENT.
    (a) COMMENCEMENT. A sentence of imprisonment shall commence on the date on which the offender is received by the Department or the institution at which the sentence is to be served.
    (b) CREDIT; TIME IN CUSTODY; SAME CHARGE. Except as set forth in subsection (e), the offender shall be given credit on the determinate sentence or maximum term and the minimum period of imprisonment for the number of days spent in custody as a result of the offense for which the sentence was imposed. The Department shall calculate the credit at the rate specified in Section 3-6-3 (730 ILCS 5/3-6-3). Except when prohibited by subsection (d), the trial court shall give credit to the defendant for time spent in home detention on the same sentencing terms as incarceration as provided in Section 5-8A-3 (730 ILCS 5/5-8A-3). The trial court may give credit to the defendant for the number of days spent confined for psychiatric or substance abuse treatment prior to judgment, if the court finds that the detention or confinement was custodial.
    (c) CREDIT; TIME IN CUSTODY; FORMER CHARGE. An offender arrested on one charge and prosecuted on another charge for conduct that occurred prior to his or her arrest shall be given credit on the determinate sentence or maximum term and the minimum term of imprisonment for time spent in custody under the former charge not credited against another sentence.
    (c-5) CREDIT; PROGRAMMING. The trial court shall give the defendant credit for successfully completing county programming while in custody prior to imposition of sentence at the rate specified in Section 3-6-3 (730 ILCS 5/3-6-3). For the purposes of this subsection, "custody" includes time spent in home detention.
    (d) NO CREDIT; SOME HOME DETENTION. An offender sentenced to a term of imprisonment for an offense listed in paragraph (2) of subsection (c) of Section 5-5-3 (730 ILCS 5/5-5-3) or in paragraph (3) of subsection (c-1) of Section 11-501 of the Illinois Vehicle Code (625 ILCS 5/11-501) shall not receive credit for time spent in home detention prior to judgment.
    (e) NO CREDIT; REVOCATION OF PAROLE, MANDATORY SUPERVISED RELEASE, OR PROBATION. An offender charged with the commission of an offense committed while on parole, mandatory supervised release, or probation shall not be given credit for time spent in custody under subsection (b) for that offense for any time spent in custody as a result of a revocation of parole, mandatory supervised release, or probation where such revocation is based on a sentence imposed for a previous conviction, regardless of the facts upon which the revocation of parole, mandatory supervised release, or probation is based, unless both the State and the defendant agree that the time served for a violation of mandatory supervised release, parole, or probation shall be credited towards the sentence for the current offense.
(Source: P.A. 96-1000, eff. 7-2-10; 97-697, eff. 6-22-12.)