
762 N.E.2d 717 (2002)
326 Ill. App.3d 1070
261 Ill.Dec. 148
In re JESUS R., a Minor (The People of the State of Illinois, Petitioner-Appellee,
v.
Jesus R., a Minor, Respondent-Appellant).
No. 4-99-0863.
Appellate Court of Illinois, Fourth District.
January 16, 2002.
Daniel D. Yuhas, Deputy Defender (Court-appointed), Susan M. Wilham, Assistant Defender, Office of State Appellate Defender, Springfield, for Jesus R.
Tony Lee, State's Attorney, Paxton, Norbert J. Goetten, Director, Robert J. Biderman, Deputy Director, State's Attorneys Appellate Prosecutor, Springfield, for the People.
Justice KNECHT delivered the opinion of the court:
Respondent minor, Jesus R. (born August 8, 1984) (hereinafter J.R.), was adjudicated a delinquent and committed to the Department of Corrections, Juvenile Division (DOC), for an indeterminate period, not to exceed his twenty-first birthday. J.R. appeals from the trial court's dispositional order committing him to the DOC, contending (1) the trial court erred when it committed him to the DOC until age 21; and (2) he is entitled to sentencing credit for 163 days served prior to his commitment to the DOC. We reverse the trial court's dispositional order and remand with directions.


*718 I. BACKGROUND
Respondent minor, J.R., was adjudicated delinquent (705 ILCS 405/5-105(3) (West 1998)) after the trial court found him guilty of aggravated battery (720 ILCS 5/12-4(8) (West 1998)) and illegal consumption of alcohol by a minor (235 ILCS 5/6-20 (West 1992)). After an October 5, 1999, dispositional hearing, the trial court entered a dispositional order committing J.R. to DOC for an indeterminate period. The dispositional order stated J.R.'s term of commitment could not exceed his twenty-first birthday. This appeal followed.
Recitation of the facts of the incidents leading to J.R.'s commitment is unnecessary for purposes of this appeal.

II. ANALYSIS

A. Term of Commitment
J.R. first contends the trial court erred when it committed him to DOC until age 21 for the Class 3 felony of aggravated battery. The Juvenile Court Act of 1987(Act) states; "[i]n no event shall a guilty minor be committed to [DOC] for a period of time in excess of that period for which an adult could be committed for the same act." 705 ILCS 405/5-710(7) (West 2000). The maximum nonextended sentence available to an adult who is convicted of the Class 3 felony of aggravated battery is five years. 730 ILCS 5/5-8-l(a)(6) (West 2000).
J.R. was adjudicated a delinquent on October 5, 1999, made a ward of the court, and committed to DOC until his twenty-first birthday. Because J.R. will not attain the age of 21 until August 8, 2005, if he remains in DOC until age 21, he will have served a term of 5 years, 10 months, and 3 days. This clearly exceeds the five-year maximum sentence an adult offender could receive for the same offense.
The State concedes J.R.'s commitment to DOC until his twenty-first birthday would exceed the five-year maximum nonextended term for Class 3 felony aggravated battery. Therefore, the dispositional order committing J.R. to DOC until his twenty-first birthday violates section 5-710 of the Act. 705 ILCS 405/5-710(7) (West 2000). Accordingly, we remand the cause so a corrected dispositional order may be entered.

B. Credit for Time Served
Respondent next argues he is entitled to 163 days' credit for time served prior to his commitment to DOC. Respondent was taken into custody for the charged offenses on April 26, 1999. He remained in custody until his dispositional hearing on October 5, 1999, when he was committed to DOC. Respondent urges this court to remand the cause and order the trial court to apply the proper credit of 163 days to his commitment in DOC. We agree.
Criminal defendants are entitled to sentencing credit for each day spent in custody. People v. Hutchcraft, 215 Ill. App.3d 533, 535, 158 Ill.Dec. 944, 574 N.E.2d 1337, 1338 (1991). In In re E.C., 297 Ill.App.3d 177, 180, 231 Ill.Dec. 550, 696 N.E.2d 846, 848 (1998), we examined the plain meaning of the Act to ascertain and give effect to the legislative intent, and concluded juveniles are also entitled to sentencing credit for time served prior to their commitment to DOC. Specifically, we looked to section 5-710(1)(a)(v) of the Act, which expressly provides juveniles are entitled to sentencing credit when their dispositions involve a sentencing order of detention. 705 ILCS 405/5-710(1)(a)(v) (West 2000). We then examined section 5-710(1)(b), which states the time juveniles spend in DOC as part of their disposition "shall be considered as time spent in detention." (Emphasis added.) 705 ILCS 405/5-710(1)(b) (West 2000). When these *719 provisions are considered along with the provision providing "[i]n no event shall a guilty minor be committed to [DOC] for a period of time in excess of that period for which an adult could be committed for the same act" (705 ILCS 405/5-710(7) (West 2000)), we find no support for denying a minor credit for time served prior to his commitment to DOC. To deny a juvenile credit for time served could lead to a total commitment that exceeds the maximum time an adult could serve for the same offense. This is a result contrary to the express provisions of the Act itself.
The State concedes under the rationale of E.C., J.R. is entitled to receive credit against his sentence for the 163 days served prior to his commitment. However, the State invites us to apply the reasoning of a Second District case which held that section 5-8-7(b) of the Unified Code of Corrections (Unified Code) does not allow a juvenile delinquent who has been committed for an indeterminate term in DOC to receive credit for time served prior to his commitment. In re J.J.M., 299 Ill.App.3d 327, 332, 233 Ill.Dec. 896, 701 N.E.2d 1170, 1173-74 (1998); 730 ILCS 5/5-8-7(b) (West 1996) (offender entitled to credit for time served spent in custody as a result of the offense for which the sentence was imposed). The gist of the court's reasoning in J.J.M. for not extending credit for time served was juveniles are not "similarly situated" to the adult criminal defendant, and it is not the purpose of the Unified Code and the Act to treat them similarly. J.J.M., 299 Ill. App.3d at 330-32, 233 Ill.Dec. 896, 701 N.E.2d at 1173-74. However, as discussed above, the Act itself refers to provisions of the Unified Code to determine proper terms of juvenile commitment to DOC and affords the juvenile the same procedural protections as the adult criminal.
Further, recent amendments to the Act have resulted in juvenile proceedings that are strikingly similar to adult criminal proceedings. Our supreme court recently stated the Act "has been reconfigured and now contains a purpose and policy section which represents a fundamental shift from the singular goal of rehabilitation to include the overriding concerns of protecting the public and holding juvenile offenders accountable for violations of the law." In re A.G., 195 Ill.2d 313, 317, 253 Ill.Dec. 911, 746 N.E.2d 732, 735 (2001). While proceedings under the Act are still not "criminal" in nature and the primary purpose of the Act is the rehabilitation of the juvenile offender (In re Beasley, 66 Ill.2d 385, 389, 6 Ill.Dec. 202, 362 N.E.2d 1024, 1026 (1977)), the Act has clearly evolved to include facets that resemble adult criminal proceedings. Therefore, we decline to follow the Second District's reasoning in J.J.M., which rests primarily on the "distinct" differences between the juvenile and adult criminal court systems.
We note our reasoning and holding in E.C. was recently cited with approval and applied by the Third District when the court determined a juvenile was entitled to credit for his predispositional confinement when the juvenile was committed to DOC under section 5-815(f) of the Act; this section provides for the commitment of the habitual juvenile offender. In re B.L.S., 325 Ill.App.3d 96, 100, 258 Ill.Dec. 948, 757 N.E.2d 637, 641 (2001); 705 ILCS 405/5-815(f) (West 2000).
Accordingly, we stand by our reasoning in E.C. and find J.R. is entitled to receive 163 days' credit against the term of his commitment to DOC for time he spent in custody prior to the entry of his dispositional order.

III. CONCLUSION
We reverse the trial court's dispositional order and remand the cause for the entry *720 of a new dispositional order consistent with this decision.
Reversed and remanded with directions.
McCULLOUGH, P.J., and MYERSCOUGH, J., concur.
