
673 N.W.2d 182 (2003)
STATE of Minnesota, Respondent,
v.
Jesus NMN SERENA, Appellant.
No. A03-362.
Court of Appeals of Minnesota.
December 30, 2003.
Review Granted February 17, 2004.
*184 John M. Stuart, State Public Defender, Theodora Gaïtas, Assistant State Public Defender, Minneapolis, MN, for appellant.
Mike Hatch, Attorney General, St. Paul, MN; and Lisa N. Borgen, Clay County Attorney, Scott G. Collins, Assistant County Attorney, Moorhead, MN, for respondent.
Considered and decided by WRIGHT, Presiding Judge; SHUMAKER, Judge; and CRIPPEN, Judge.[*]

OPINION
WRIGHT, Judge.
Appealing from the district court's denial of jail credit for time spent in a juvenile correctional facility prior to the execution of his adult sentence of imprisonment, appellant Jesus Serena argues that (1) Minn. Stat. § 260B.130, subd. 5 (2000), does not restrict all jail credit for time spent in juvenile custody as a condition of probation; (2) application of the jail-credit restriction in Minn.Stat. § 260B.130, subd. 5, to appellant, who committed the offense of conviction before the effective date of the statute's jail-credit restriction, violates the constitutional proscription against ex post facto laws; and (3) prohibiting extended jurisdiction juvenile offenders from receiving jail credit for time spent in a juvenile facility violates the equal protection guarantees of the United States and Minnesota constitutions. We affirm.


*185 FACTS
On May 10, 2000, appellant Jesus Serena, who was a juvenile, was convicted of two counts of aiding and abetting second-degree assault, in violation of Minn.Stat. §§ 609.05, .222, subd. 1 (1998). The district court sentenced Serena under the extended jurisdiction juvenile (EJJ) statute, Minn.Stat. § 260B.130 (1998). The district court imposed two consecutive 21-month terms, stayed the execution of both sentences, and placed Serena on probation. As one of several conditions of probation, Serena was ordered to successfully complete the Prepare Program at the Minnesota Correctional Facility at Red Wing (MCF-Red Wing).
While at MCF-Red Wing, Serena pleaded guilty to aiding and abetting first-degree aggravated robbery, in violation of Minn.Stat. §§ 609.05, .245, subd. 1 (1998). Serena committed the robbery on January 26, 1999, prior to entering MCF-Red Wing. The district court imposed a 58-month sentence to run concurrently with the sentences for the assault convictions, stayed the execution of the sentence, and also ordered successful completion of the Prepare Program as one of the conditions of probation.
Serena was released from MCF-Red Wing after 459 days. Shortly thereafter, Serena violated two conditions of his probation by testing positive for a controlled substance and absconding from supervision. As a consequence, the district court revoked Serena's EJJ status but continued the stay of execution of the adult sentences. The district court ordered Serena to serve 30 days in jail as a sanction for the probation violation. After Serena failed to report to jail, the district court revoked Serena's probation and executed the previously stayed sentences.
During the revocation hearing, Serena requested jail credit for time served at MCF-Red Wing. The district court denied Serena's request, stating, "[u]nder the EJJ law, the court has no discretion to give you that time." Serena filed a formal motion for jail credit, and the district court again denied his request. This appeal followed.

ISSUES
I. Did the district court err in concluding that, upon the execution of an adult sentence, Minn.Stat. § 260B.130, subd. 5 (2000), prohibits jail credit for time served by extended jurisdiction juvenile offenders committed to a juvenile facility as a condition of probation?
II. Did the district court's denial of appellant's request for jail credit violate the constitutional proscription against ex post facto laws?
III. Does application of the extended jurisdiction juvenile jail-credit restriction to appellant violate the equal protection guarantees of the United States and Minnesota constitutions?

ANALYSIS

I.
Generally, a defendant is entitled to credit for "all time spent in custody in connection with the offense or behavioral incident for which sentence is imposed." Minn. R.Crim. P. 27.03, subd. 4(B). The decision to grant jail credit is not discretionary with the district court. State v. Fritzke, 521 N.W.2d 859, 861 (Minn.App. 1994). Although an offender may receive treatment either as part of confinement in a state correctional facility or as part of a residential treatment program, the sentencing guidelines only permit jail credit for the correctional facility treatment. State v. Bradley, 629 N.W.2d 462, 465 (Minn.App.2001), review denied (Minn. Aug. 15, 2001); Minn. Sent. Guidelines III. C.3 (jail credit "is limited to time spent in *186 jails, workhouses, and regional correctional facilities").
Effective August 2000, the Minnesota Legislature amended Minn.Stat. § 260B.130, subd. 5, to prevent extended jurisdiction juvenile (EJJ) offenders from receiving jail credit for time served in juvenile facility custody if, after a summary hearing, the district court determines that the EJJ offender has violated the conditions of the stayed adult sentence and reasons exist to revoke the stay of execution of the adult sentence. 2000 Minn. Laws ch. 255, § 1. Under such circumstances, "the court shall treat the offender as an adult and order any of the adult sanctions authorized by section 609.14, subdivision 3, except that no credit shall be given for time served in juvenile facility custody prior to a summary hearing." Minn.Stat. § 260B.130, subd. 5 (2000) (emphasis added).
The initial question before us is one of statutory interpretation, which we review de novo. State v. Iverson, 664 N.W.2d 346, 350 (Minn.2003). When we interpret a statute, we focus on the words of the statute to "ascertain and effectuate the intention of the legislature." Minn.Stat. 645.16 (2002). If the legislative intent "is clearly discernable from plain and unambiguous language, statutory construction is neither necessary nor permitted and courts apply the statutes plain meaning." Am. Tower, L.P. v. City of Grant, 636 N.W.2d 309, 312 (Minn.2001). We first decide whether the statutory language, on its face, is ambiguous. Id. A statute is ambiguous "when it is subject to more than one reasonable interpretation." Am. Family Ins. Group v. Schroedl, 616 N.W.2d 273, 277 (Minn.2000). When statutory language is ambiguous, we may consider contemporaneous legislative history to ascertain the intent of the legislature. See Minn.Stat. 645.16 (2002); Handle With Care, Inc. v. Dept. of Human Servs., 406 N.W.2d 518, 522 (Minn.1987) (tapes of legislative proceedings may be considered if helpful in interpreting a statute).
Serena argues that the 2000 amendment to the EJJ statute precludes jail credit only for the period between the offender's arrest for a probation violation and the summary hearing. Thus, the jail-credit restriction, Serena contends, applies only when an offender challenges the reasons for revoking EJJ by requesting a summary hearing, rather than admitting the probation violation resulting in the revocation. The state counters that the amendment prohibits jail credit for any time served in a juvenile facility while the offender is under juvenile jurisdiction. Because the language of the statute is subject to at least two reasonable interpretations, we consult the legislative history of the 2000 amendment to the EJJ statute to discern the intent of the legislature.
Legislative history regarding the 2000 amendment reflects a clear intent to restrict jail credit for any time spent in juvenile facility custody as an EJJ offender. In testimony before the Crime Prevention Committee, Deb Eng of the Minnesota Department of Corrections stated that the amendment "would clarify that while a juvenile is serving their juvenile disposition, and if they were to violate [their conditions of probation], they would not be given credit for the time spent under the juvenile disposition." Hearing on H.F. No.2067 Before the Crime Prevention Comm. (Mar. 29, 1999). Representative Andrew Westerberg, the author of the amendment, stated further:
[B]y giving [offenders] the advantage of going with EJJ, what we're doing here is we're trying to hold a big stick, basically, over their head that says, you know, if you don't complete this other option  this softer option  then you'll *187 be hit with the harder option. The problem comes in situations where if the softer option is being abided to and [then] violated close to the end of the harsher sentence, then the harsher sentence has much less of an effect. So what we want to do, basically, is still hold the balance of the harsher sentence  the entire harsh sentence  over and above them to get them to complete the softer sentence.
Id. (emphasis added). Thus, contrary to Serena's assertion, the jail-credit restriction is not limited to time spent in custody between the arrest for the probation violation and the summary hearing. Rather, under the EJJ statute, upon revocation of the stay of execution of the adult sentence, the offender who is now subject to adult sanctions shall not receive custody credit for any time served in a juvenile facility under the juvenile disposition.
In a related argument, Serena contends that he is entitled to custody credit for time served at MCF-Red Wing because it is a correctional facility, not a "juvenile facility" as contemplated by the statute. This argument also is unavailing. Section 260B.130, subdivision 5, proscribes giving jail credit for any time served in "juvenile facility custody" under the juvenile disposition. The statute neither defines the term "juvenile facility" nor distinguishes between a correctional facility that houses juveniles and a juvenile facility. MCF-Red Wing is a correctional facility for juveniles. Asfaha v. State, 665 N.W.2d 523, 527 (Minn.2003). Because Minn.Stat. § 260B.130, subd. 5, prohibits giving an EJJ offender serving an adult sentence jail credit for any juvenile facility custody, the district court properly denied Serena jail credit for time served under EJJ at MCF-Red Wing.

II.
Serena next argues that applying the 2000 amendment to the EJJ statute to deny him custody credit for time served in a juvenile facility violates the constitutional prohibition against ex post facto laws. Whether the application of a statute is unconstitutional is a question of law, which we review de novo. State v. Behl, 564 N.W.2d 560, 566 (Minn.1997). "Minnesota statutes are presumed constitutional, and our power to declare a statute unconstitutional should be exercised with extreme caution and only when absolutely necessary." In re Haggerty, 448 N.W.2d 363, 364 (Minn.1989). To challenge successfully the constitutionality of a statute, a party must demonstrate beyond a reasonable doubt that the statute is unconstitutional. State v. Merrill, 450 N.W.2d 318, 321 (Minn.1990).
Both the United States and Minnesota constitutions prohibit the enactment and application of ex post facto laws. U.S. Const. art. I, § 9, cl. 3; Minn. Const. art. I, § 11; Starkweather v. Blair, 245 Minn. 371, 386, 71 N.W.2d 869, 879-80 (1955); State v. Grillo, 661 N.W.2d 641, 644 (Minn.App.2003), review denied (Minn. Aug. 5, 2003). "The ex post facto prohibition forbids the Congress and the States to enact any law `which imposes a punishment for an act which was not punishable at the time it was committed; or imposes additional punishment to that then prescribed.'" Weaver v. Graham, 450 U.S. 24, 28, 101 S.Ct. 960, 964, 67 L.Ed.2d 17 (1981). This prohibition ensures that individuals receive "fair warning" of the effect of legislative acts, permitting reliance on a statute until it has been explicitly revised. Id. at 28-29, 101 S.Ct. at 964. The critical question in determining whether application of a statute violates the ex post facto prohibition is whether the enactment or amendment of the law changes the legal *188 consequences of acts completed before its effective date. Id.
Serena argues that, because section 260B.130, subdivision 5, did not place any restrictions on jail credit at the time he committed the offenses, application of the 2000 amendment to the EJJ statute, which prohibits giving jail credit for time served in juvenile facility custody against an executed adult sentence, changes the legal consequences of acts he committed before the jail-credit prohibition was enacted. We disagree.
As amended, section 260B.130, subdivision 5, did not disadvantage Serena by increasing his original sentence. The inability to receive jail credit is based on Serena's commission of an act committed after the enactment of the 2000 amendment  namely, failure to report to jail as a sanction for violating conditions of his probation. Serena violated the conditions of his probation after the 2000 amendment's effective date. Thus, at the time of the violation, he had fair warning that jail credit would not be awarded if the district court revoked his stayed adult sentence. See Weaver, 450 U.S. at 28-29, 101 S.Ct. at 964; see also State v. Garcia, 670 N.W.2d 297, 299 (Minn.App.2003) (holding that the 2000 amendment did not violate the ex post facto clause because "[w]hen enacted, the [2000] amendment merely exposed appellant to possible additional punishment in the event of a future probation violation"), review granted (Minn. Dec. 23, 2003); Gasper v. Gunter, 851 P.2d 912, 918 (Co.1993) (holding that application of a statute prohibiting credit for time on parole did not implicate ex post facto prohibition because the forfeiture of jail credit was based on "an incident discrete from the [] sentencing arising out of [the offender's] felony convictions"); but see Haas v. Hathaway, 144 Or.App. 478, 928 P.2d 331, 334-35 (1996) (holding that application of statute violated the Oregon ex post facto clause because failure to give credit for time served as a condition of probation resulted in greater punishment than permitted when the original offense was committed). Because application of the 2000 amendment to the EJJ statute was triggered by acts Serena committed after the amendment's effective date, such application does not violate the prohibition against ex post facto laws.

III.
A juvenile certified as an adult receives custody credit for time served in a juvenile facility, but an EJJ offender whose adult sentence is executed does not. Because of this distinction, Serena argues that Minn. Stat. 260B.130, subd. 5, violates the equal protection guarantees of the United States and Minnesota constitutions.
The Fourteenth Amendment to the United States Constitution provides that "[no state shall] deny to any person within its jurisdiction the equal protection of the laws." U.S. Const. amend. XIV, § 1. The Minnesota Constitution states that "[n]o member of this state shall be disenfranchised or deprived of any of the rights or privileges secured to any citizen thereof, unless by the law of the land or the judgment of his peers." Minn. Const. art. 1, § 2. Both clauses have been analyzed under the same principles and require that the state treat all similarly situated persons alike. Scott v. Minneapolis Police Relief Assn., Inc., 615 N.W.2d 66, 74 (Minn.2000); Behl, 564 N.W.2d at 568. "[F]acial distinctions based on age and charged offenses do not create suspect classifications." Behl, 564 N.W.2d at 568.
In the absence of a suspect classification, distinctions made among offenders to determine jail-credit eligibility must be rationally related to a legitimate *189 government purpose under the federal constitution. See McGinnis v. Royster, 410 U.S. 263, 270, 93 S.Ct. 1055, 1059, 35 L.Ed.2d 282 (1973). Likewise, we apply a rational-basis standard under the Minnesota Constitution and require "a reasonable connection between the actual, and not just the theoretical, effect of the challenged classification and the statutory goals." State v. Russell, 477 N.W.2d 886, 888-89 (Minn.1991) (citations omitted).
The EJJ jail-credit restriction has a reasonable connection between the actual effect of the EJJ classification and the statutory goals. The purpose of the EJJ statute is to rehabilitate serious juvenile offenders before they become serious adult offenders. See Minn. Sup.Ct. Advisory Task Force on the Juv. Justice Sys., Final Report 34 (Jan.1994) (noting that the EJJ system provides "one last chance" in which "[j]uveniles will know there is a certainty of punishment, combined with an opportunity to be successful in the juvenile system"). Juveniles who have been certified as adults have already lost their last chance in the juvenile system and are treated the same as adult offenders. By virtue of their status, EJJ offenders pose the greatest rehabilitative challenge in the juvenile system. The threat of harsh adult sanctions is rational and necessary to provide an incentive to rehabilitate serious juvenile offenders. The distinction between the EJJ offender and a juvenile certified as an adult may be harder to discern at the point when the EJJ offender fails to comply with the conditions of the stay and has the adult sentence executed. But the EJJ statute's purpose is to facilitate successful completion of the juvenile disposition, not coordination with adult sentences for those who fail.
In addition to the EJJ offender receiving the benefit of intensive services and supervision to enhance the offender's chance of succeeding, an important component of this incentive-based statutory scheme is the deterrent effect produced by the threat of serving the full adult sentence. To that effect, the EJJ statute requires the district court to impose an adult criminal sentence, the execution of which is stayed, provided the offender complies with conditions of probation. Minn.Stat. 260B.130, subd. 4(a)(2) (2000). Giving jail credit for juvenile custody upon the revocation of the stay would erode the punitive consequences of an executed adult sentence. Giving jail credit to juveniles certified as adults does not diminish the deterrence against violating probation any more than it does for adult offenders generally. And it is unnecessary to provide an incentive to certified juveniles to remain in the juvenile system because they have already left it. Because the jail-credit restriction is a rational means to encourage the rehabilitation of EJJ offenders, the 2000 amendment does not violate the equal protection guarantees of the United States and Minnesota constitutions.

DECISION
The district court, based on Minn.Stat. § 260B.130, subd. 5 (2000), properly denied Serena's request for jail credit. Application of section 260B.130, subdivision 5, to Serena, whose adult sentence was stayed prior to the 2000 amendment and executed pursuant to a probation violation committed after the amendment, does not violate the constitutional prohibition against ex post facto legislation. And the 2000 amendment does not violate the equal protection guarantees of the United States and Minnesota constitutions.
Affirmed.
CRIPPEN, Judge (concurring in part, dissenting in part).
Under the statutory scheme at issue, jail credit is extended to a dangerous juvenile *190 offender who is certified for adult-court prosecution and whose sentence is first stayed but later executed because of violations of stay conditions. A less dangerous juvenile of like age, who has committed an offense equally or less serious, whose circumstances are less threatening to public safety, and who is not certified, is denied the same jail credit when his stayed sentence is similarly executed.
The practice of holding a more threatening stick over the less dangerous juvenile is rational, the state asserts, because it modifies conduct of the juvenile that will spare this offender from the consequence of an adult sentence. The approach is also important, the state contends, because of the great challenge the public accepts in attempting to rehabilitate the offender who is still subject to juvenile court jurisdiction. If the size of the stick is moderated, the state suggests, the public will to help less dangerous juveniles will be eroded.
No doubt a less dangerous juvenile adversely affected by these laws would plead to be helped less diligently. And this simple reaction is constitutionally compelling. To conclude otherwise is to open the door to euphemistic approaches that with the one hand herald the rehabilitative purposes of the juvenile system and with the other enlarge the license to punish those the system is to help. See Application of Gault, 387 U.S. 1, 27, 87 S.Ct. 1428, 1443, 18 L.Ed.2d 527 (1967) (calling for "reality" in recognizing incarceration, "however euphemistic the title."). "Tough love" may be attractive in private contexts, but it does not represent an acceptable basis for public laws that impose greater punishment for less dangerous juveniles than for more dangerous juvenile offenders who are loved less and have been certified for adult-court prosecution.
The meaning of the state's position on jail credits can be appreciated by considering the implications of the approach where the courts are not dealing with an EJJ case or even a serious offense. If there is rationality in big threats to less dangerous children, one is led to find rationality in laws providing punitive, severe consequences for failure to immediately discontinue a pattern of minor or even petty misconduct.
Finally, the rationality of the state's position is not enlarged, in my opinion, by failing to recognize the readiness of the helping hand to impose a severe penalty. It is true that the law is built on a hope that there will be no executed sentence, but this wish does not diminish the realistic anticipation that violations of stay conditions commonly occur and that execution of sentences is a material part of the EJJ process. And there is little merit in assuming that the big stick will not be employed carelessly from time to time, or that it will not be utilized grudgingly by the "helping" hand that waits too eagerly for the opportunity to act on the threat to punish; these mistaken approaches are most evident in the choice of stay conditions that are excessively imprecise, numerous, or otherwise difficult to honor.
Because there is too little rationality in the notion that benevolence to an offender explains treating this person more severely than another in like circumstances, I respectfully dissent from the majority's rejection of appellant's assertion that he has been denied equal protection of the laws. I concur in decisions of the majority on other issues of the case.
NOTES
[*]  Retired judge of the Minnesota Court of Appeals, serving by appointment pursuant to Minn. Const. art. VI, § 10.
