
696 N.E.2d 846 (1998)
297 Ill. App.3d 177
231 Ill.Dec. 550
In the Interest of E.C., a Minor (The People of the State of Illinois, Petitioner-Appellee,
v.
E.C., a Minor, Respondent-Appellant).
No. 4-97-1086.
Appellate Court of Illinois, Fourth District.
June 26, 1998.
*847 Daniel D. Yuhas, Deputy Defender (Court-appointed), Martin J. Ryan, Asst. Defender, Office of State Appellate Defender, Springfield, for E.C.
John C. Piland, Champaign County State's Attorney, Urbana, Norbert J. Goetten, Director, Robert J. Biderman, Deputy Director, Denise M. Ambrose, Senior Staff Atty., State's Attorneys Appellate Prosecutor, Springfield, for the People.
Justice McCULLOUGH delivered the opinion of the court:
Respondent minor E.C. (born May 15, 1980) appeals from the orders of the circuit court of Champaign County adjudicating him a delinquent minor and committing him to the Department of Corrections, Juvenile Division (DOC). The issues are whether (1) E.C. is entitled to 15 days' sentence credit for time previously served and (2) his period of commitment must be reduced to a maximum of three years. We affirm in part, reverse in part, and remand with directions.
E.C. admitted committing the offense of unlawful use of a weapon (720 ILCS 5/24-1(a)(4) (West 1996)). Following a dispositional hearing on July 3, 1997, E.C. was placed on six months' conditional discharge conditioned on serving 30 days in the Champaign County Correctional Center, with credit for four days previously served. On August 27, 1997, the State filed a petition to revoke conditional discharge alleging failure to report to the probation department on two occasions and advise the probation officer of a change in telephone number. E.C. admitted and stipulated to the allegations in the petition to revoke conditional discharge. On November 18, 1997, following another dispositional hearing, E.C. was committed to DOC for an indeterminate term that would automatically terminate upon E.C. attaining age 21, unless he is discharged sooner on parole "or custodianship is otherwise terminated in accordance with the Juvenile Court Act or as otherwise provided for by law."
E.C. argues that, since his twenty-first birthday will be May 15, 2001, he will be committed to DOC for more than the three-year maximum term of imprisonment for an adult with the same offense as he committed, in violation of section 5-23(7) of the Juvenile Court Act of 1987 (Act) (705 ILCS 405/5-23(7) (West 1996)). A first offense of unlawful use of a weapon, as charged in this case, is a Class 4 felony. 720 ILCS 5/24-1(b) (West 1996). For an adult, a Class 4 felony carries a nonextended term of imprisonment of not less than one year and not more than three years. 730 ILCS 5/5-8-1(a)(7) (West 1996). Section 5-33(2) of the Act provides that a delinquent minor may be given an indeterminate term in DOC that automatically terminates at age 21 "unless the delinquent is sooner discharged from parole or custodianship is otherwise terminated in accordance with this Act or as otherwise provided for by law." 705 ILCS 405/5-33(2) (West 1996). The trial court may enter a dispositional order committing a delinquent minor to DOC consistent with section 5-33 of the Act if the minor is 13 years of age or older and a term of incarceration is permitted by law for adults found guilty of the offense for which the minor is adjudicated delinquent (705 ILCS 405/5-23(1)(b) (West 1996)), but "[i]n no event shall a delinquent minor be committed 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-23(7) (West 1996)).
In construing the statutes involved, the primary consideration is to ascertain and give effect to the legislative intent. The language of the statute is the best evidence of legislative intent. In re A.P., 179 Ill.2d 184, 195, 227 Ill.Dec. 949, 688 N.E.2d 642, 648 (1997).
The State does not argue that the statutes are ambiguous or that the plain language *848 of the statutes means something other than it clearly says. Instead, the State, without citing any legal authority other than the statutes, seems to argue that the trial court has the discretion to commit a delinquent minor to DOC until age 21 in spite of the language of section 5-23(7) of the Act because section 5-33(2) allows for it. Section 5-33(2) makes it clear that the commitment is subject to being terminated earlier if "in accordance with this Act or as otherwise provided by law." 705 ILCS 405/5-33(2) (West 1996). The trial court in this case should have committed E.C. to DOC for no more than three years as mandated by section 5-23(7).
E.C. acknowledges that this precise issue was not raised in the trial court, although E.C.'s trial counsel did argue that an indeterminate commitment would be longer than what E.C. would have received if tried and convicted as an adult. However, the portion of a sentence in excess of what a statute permits is void, and a void order may be attacked at any time. In re T.E., 85 Ill.2d 326, 333, 53 Ill.Dec. 241, 423 N.E.2d 910, 913 (1981) (indefinite order of probation imposed on juvenile was void). Since the commitment of E.C. to DOC beyond three years is void, E.C. was not precluded from raising this issue in this appeal.
For the same reasons in limiting the term of commitment, E.C. is also entitled to the 15 days' credit for time previously served. 730 ILCS 5/5-8-7(b) (West 1997). We note that section 5-23(1)(b) of the Act provides that as to the respondent's commitment to DOC, "The time during which a minor is in custody before being released * * * shall be considered as time spent in detention." 705 ILCS 405/5-23(1)(b). The rationale for determining credit for detention pursuant to section 5-23(1)(a)(5) gives further support for granting the credit in this case. 705 ILCS 405/5-23(1)(a)(5).
The issue of whether section 5-23(7) of the Act requires application of the credit for time previously served was not raised in the trial court, and indeed was not specifically raised here, although E.C. does argue he is entitled to the 15 days' credit because double jeopardy principles apply equally to juveniles and adults. It is unnecessary to decide the constitutional question. In People v. Moore, 289 Ill.App.3d 357, 363, 224 Ill.Dec. 468, 681 N.E.2d 1089, 1093 (1997), and People v. Gwartney, 289 Ill.App.3d 350, 356-57, 225 Ill.Dec. 329, 683 N.E.2d 497, 501 (1997), this court held that, when defense trial counsel agrees with an incorrect calculation of the sentence credit provided in section 5-8-7(b) of the Unified Code of Corrections, the issue of miscalculation of the sentence credit is waived. However, supreme court supervisory orders vacated and remanded both Moore and Gwartney to give the defendants in those cases the sentencing credits. People v. Moore, 175 Ill.2d 545, 227 Ill.Dec. 827, 688 N.E.2d 308 (1997) (nonprecedential supreme court supervisory order); People v. Gwartney, 175 Ill.2d 539, 227 Ill.Dec. 827, 688 N.E.2d 308 (1997) (nonprecedential supreme court supervisory order). In light of the supreme court's orders, we deem the issue of sentence credit is not waived, consistent with the supreme court's decision regarding the $5-per-day credit against fines in People v. Woodard, 175 Ill.2d 435, 453-57, 222 Ill.Dec. 401, 677 N.E.2d 935, 944-46 (1997).
It is unnecessary to decide whether the sentencing credit applies to a properly imposed indeterminate commitment of a delinquent minor to DOC.
Accordingly, the adjudication of E.C. as a delinquent minor is affirmed, but the dispositional order is reversed, and the cause is remanded for the entry of a new dispositional order consistent with this decision.
Affirmed in part, reversed in part, and remanded with directions.
GARMAN, P.J., and COOK, J., concur.
