
937 P.2d 581 (1997)
132 Wash.2d 203
The STATE of Washington, Respondent,
v.
Robert Baker ANDERSON, Appellant.
No. 64348-2.
Supreme Court of Washington, En Banc.
Argued March 26, 1997.
Decided May 29, 1997.
*582 Knapp, O'Dell & Lewis, R.A. Lewis, Camas, Robert B. Anderson, Walla Walla, for Appellant.
Robert B. Anderson, pro se.
Arthur Curtis, Clark County Prosecutor, Philip Meyers, Deputy, Vancouver, for Respondent.
DOLLIVER, Justice.
Defendant claims he should receive jail time credit for the three years he spent on electronic home detention while he unsuccessfully appealed his criminal conviction. We hold the Equal Protection Clause entitles Defendant to the claimed credit.
Defendant, Robert Baker Anderson, was convicted of attempted murder in the second degree and given a nine-year sentence. On the day of his sentencing, Defendant filed an appeal of his conviction and asked the trial court to release him from custody pending the appeal. The trial court agreed to release Defendant under certain strict conditions. Defendant was to post a bail bond of $35,000, and he was to be placed on electronic home detention. He was forbidden from contacting the victim or her family. He was forbidden from using drugs or alcohol and was subject to testing for such substances. He was to live with his brother in King County, and he was allowed to leave the house only to go to work at his brother's job site and to attend anger management classes.
Defendant posted the bond and was released into electronic home detention on February 26, 1992. The Court of Appeals affirmed his conviction in an unpublished opinion. State v. Anderson, 74 Wash.App. 1045 (1994). On February 9, 1995, Defendant's petition for review was denied by this court. State v. Anderson, 125 Wash.2d 1024, 890 P.2d 464 (1995) (memorandum). On March 10, 1995, the Court of Appeals issued its mandate to the trial court, and the trial court revoked Defendant's release and ordered the execution of his judgment. Defendant was credited for time he had spent in jail prior to his conviction and after the conviction prior to his release on bond. He was not credited, however, with the three years spent on electronic home detention.
*583 Defendant now appeals the trial court's refusal to credit him with time served on home detention. Defendant also filed a personal restraint petition (PRP) raising the same issue. The Court of Appeals consolidated the PRP with the appeal and certified the appeal to this court.

I
Defendant first claims he is statutorily entitled to credit for time spent on home detention. His argument relies on a synthesis of several different statutes, RCW 9.94A.030, 9.94A.120, 9.95.060, and 9.95.062. RCW 9.94A.120(16) requires a sentencing court to
give the offender credit for all confinement time served before the sentencing if that confinement was solely in regard to the offense for which the offender is being sentenced.
Confinement is defined as "total or partial confinement as defined in this section." RCW 9.94A.030(8). Partial confinement is defined as
confinement ... if home detention or work crew has been ordered by the court, in an approved residence, for a substantial portion of each day with the balance of the day spent in the community. Partial confinement includes work release, home detention, work crew, and a combination of work crew and home detention as defined in this section.
RCW 9.94A.030(26).
"Home detention" means a program of partial confinement available to offenders wherein the offender is confined in a private residence subject to electronic surveillance.
RCW 9.94A.030(42).
The combination of these quoted statutes requires a sentencing court to credit a defendant with time served on electronic home detention prior to sentencing. State v. Speaks, 119 Wash.2d 204, 829 P.2d 1096 (1992). In Speaks, the defendant was placed on electronic home detention while awaiting his trial for child molestation. After Speaks was convicted, the sentencing court refused to credit him for the time he had served on home detention. The Court of Appeals, affirming the sentencing court, likened home detention to being on probation, for which no credit is given. State v. Speaks, 63 Wash.App. 5, 7-8, 816 P.2d 95 (1991), rev'd, 119 Wash.2d 204, 829 P.2d 1096 (1992). This court reversed, reasoning that RCW 9.94A.030 and RCW 9.94A.120 require a sentencing court to credit a defendant with time served on home detention. Speaks, 119 Wash.2d at 209, 829 P.2d 1096. Compare State v. Vasquez, 75 Wash.App. 896, 899, 881 P.2d 1058 (1994) (defendant subject to home detention prior to conviction was not electronically monitored, thereby failing to meet the definition of home detention for which jail time credit is authorized).
Defendant's situation is different from that in Speaks, because Defendant's electronic home detention occurred after he had been convicted and sentenced. Former RCW 9.94A.120(13), currently RCW 9.94A.120(16), which was relied on by Speaks, addresses a sentencing court's duty to give credit for all confinement served before the sentencing. The statute does not address a defendant's right to credit for time spent on detention after sentencing. An entirely different statute, RCW 9.95.062, addresses a defendant's right to jail time credit for time spent in prison pending an appeal of the conviction. Defendant claims the reasoning used by Speaks applies equally to RCW 9.95.062.
When a convicted defendant appeals the conviction and is at liberty on bond pending the appeal, "credit on his or her sentence will begin from the date such convicted person is returned to custody." RCW 9.95.060. The issue is more specifically addressed by RCW 9.95.062(3), which states:
In case the defendant has been convicted of a felony, and has been unable to obtain release pending the appeal by posting an appeal bond, cash, adequate security, release on personal recognizance, or any other conditions imposed by the court, the time the defendant has been imprisoned pending the appeal shall be deducted from the term for which the defendant was sentenced, if the judgment is affirmed. *584 Chapter 9.95 RCW fails to define "imprisoned." Defendant urges this court to hold that "imprisoned" is interchangeable with "confinement" as defined in RCW 9.94A.030(8). If imprisonment is synonymous with confinement, then imprisonment would include electronic home detention under the statutory analysis applied by Speaks.

The State disputes Defendant's attempt to include electronic home detention within the definition of imprisonment. The State asserts that the term "imprisoned" denotes a statusbeing in jailthat is far more restrictive than Defendant's being under home detention. The State also points out Defendant's being released on bond and being placed on electronic home detention pending the outcome of his appeal are addressed by other language in RCW 9.95.062(3). Defendant "obtain[ed] release pending the appeal by posting an appeal bond," and he was subject to "other conditions imposed by the court," namely, home detention. RCW 9.95.062(3). Such conditions are explicitly authorized by RCW 9.95.064, which states:
In order to minimize the trauma to the victim, the court may attach conditions on release of a defendant under RCW 9.95.062 regarding the whereabouts of the defendant, contact with the victim, or other conditions.
The State's reading of RCW 9.95.062 is correct. RCW 9.95.062(3) authorizes jail time credit only if the defendant has been "unable to obtain release ...." (emphasis added). Defendant's being released on bond and subject to home detention do not statutorily entitle him to jail time credit.

II
Defendant's second argument relies on the Equal Protection Clause. U.S. Const. amend. XIV, § 1. Defendant does not claim an absolute constitutional right to credit for time spent on home detention; rather, he argues that once the Legislature has chosen to credit defendants for presentence electronic home detention, as recognized in Speaks, the Legislature must grant all similarly situated persons the same credit. Defendant's challenge does not involve a suspect class or a fundamental right, so the difference in treatment must pass the rational basis test. See In re Personal Restraint Petition of Borders, 114 Wash.2d 171, 176, 786 P.2d 789 (1990); cf. State v. Phelan, 100 Wash.2d 508, 514, 671 P.2d 1212 (1983) (applying intermediate scrutiny where the physical liberty of poor people is involved).
Under Speaks, had Defendant spent three years on electronic home detention prior to his conviction, his prison sentence would have been credited for those three years. By nature of the detention occurring after Defendant's conviction and pending his appeal, the State argues Defendant receives no credit for that detention. Defendant claims there is no rational basis to distinguish between presentence and postsentence electronic home detention. Numerous cases from this jurisdiction support Defendant's argument.
In Reanier v. Smith, 83 Wash.2d 342, 517 P.2d 949 (1974), several defendants had been denied credit for time spent in jail prior to their conviction and sentencing. One defendant had also spent some time in detention at Western State Hospital. Reanier looked at RCW 9.95.062, which requires credit to be given for the time a defendant is imprisoned after sentencing but pending appeal. Since the Legislature allowed credit for postconviction imprisonment pending an appeal, Reanier held the Legislature should also allow credit for similar presentence confinement:
We can see no practical, realistic or substantive difference between time spent in pretrial detention for want of bail and time spent in detention pending an appeal of a conviction or time spent under a subsequently vacated and reinstated sentence. It is all time spent in confinement and, if not credited against a maximum or mandatory minimum sentence, has the ultimate effect of enlarging the time of potential confinement dictated by the maximum or mandatory minimum sentence.
Reanier, 83 Wash.2d at 351, 517 P.2d 949. While Reanier relied, in part, on double jeopardy grounds, this does not lessen the strength of its observation that pretrial detention and postconviction detention are indistinguishable in terms of their effect on the imprisoned defendant. See also Phelan, 100 *585 Wash.2d at 516, 671 P.2d 1212 ("With regard to credit against maximum and mandatory minimum sentences, however, we rejected any distinction between presentence and postsentence incarceration in In re [Personal Restraint of] Phelan, 97 Wash.2d [590,] 595[, 647 P.2d 1026 (1982) ].") (emphasis added).
Reanier's failure to find a distinction between pretrial and postconviction confinement set the stage for the holding in In re Personal Restraint of Knapp, 102 Wash.2d 466, 687 P.2d 1145 (1984), which consolidated two different cases. Knapp was convicted of possessing a stolen motor vehicle, given a suspended sentence, and placed on probation with the condition that he enter and successfully complete a psychological counseling program at Eastern State Hospital (ESH) to treat his "irresistible impulse to steal cars." Knapp, 102 Wash.2d at 467, 687 P.2d 1145. He spent 31 months in the program, after which he left the hospital without authorization and stole a car. The trial court revoked his probation, reinstated his five-year sentence, but failed to credit him with the 31 months spent at ESH.
Knapp also considered a personal restraint petition filed by Wallin, a convicted sexual psychopath who, after his conviction for rape, served time in ESH for evaluation and subsequent treatment. After being deemed unamenable to treatment, Wallin was transferred to prison. He was given jail time credit for time spent in ESH towards his maximum term pursuant to RCW 71.06.120, but he was denied credit against his discretionary minimum prison term. Wallin claimed he was entitled to credit towards his discretionary minimum term.
Knapp held both petitioners were entitled to full jail time credit under the Equal Protection Clause. Knapp first looked to Reanier where one of the defendants had spent time both in Western State Hospital and in jail prior to his conviction and sentence. In holding the defendant was entitled to jail time credit for the pretrial confinement, Reanier did not distinguish between time spent at Western State Hospital and time spent in jail when awarding the credit. Knapp, 102 Wash.2d at 470, 687 P.2d 1145 (citing Reanier, 83 Wash.2d at 343, 517 P.2d 949). Knapp then looked to RCW 71.06.120 and RCW 72.68.031. RCW 71.06.120 states: "Time served by a sexual psychopath in a state hospital shall count as part of his sentence whether such sentence is pronounced before or after adjudication of his sexual psychopathy." RCW 72.68.031 provides that a prisoner's sentence shall continue to run if the prisoner needs mental care and is transferred to a state mental hospital. Knapp reasoned:
Both Knapp and Wallin were found guilty of violating the criminal law and the trial courts in each case determined that they were in need of treatment for mental health problems which led to their criminal behavior. Yet the Legislature has granted one petitioner, Wallin, credit for time spent in "treatment", RCW 71.06.020, while the other petitioner, Knapp, is denied credit for essentially the same custodial confinement. Neither respondent effectively addresses this disparate treatment; and we discern no difference between the petitioners meriting this distinction in treatment.
More importantly, the Legislature has recognized that persons sent to prison and then transferred to a state hospital for "observation, diagnosis or treatment" should be given credit for their time confined in the treatment facility. RCW 72.68.031. Neither respondent addresses the dissimilar treatment of persons initially sent to prison and then sent to a state mental hospital for treatment, and persons initially sent to a state hospital for treatment, as a sexual psychopath or as a condition of probation, and then subsequently sent to prison. Both groups are sent to the hospital for "treatment" and not "punishment" yet the former group receives full sentence credit for their hospital time while the latter group, under the State's analysis, would be denied the same credit. There is no logical reason for distinguishing between persons who are transferred to mental health facilities after confinement in prison and persons originally sent to mental health facilities by the sentencing court prior to confinement in prison. State v. McCarter, 91 Wash.2d 249, 256, 588 P.2d 745 (1978).

*586 Additionally, neither respondent addresses why pretrial and presentence hospital time is credited, Reanier v. Smith, 83 Wash.2d 342, 517 P.2d 949 (1974), but posttrial hospital time is not credited. In re Phelan, 97 Wash.2d 590, 595, 647 P.2d 1026 (1982) rejected any distinction between presentence and postsentence incarceration and that principle is applicable here. These distinctions in treatment do not withstand an equal protection challenge. If the Legislature recognizes that one member of the class should receive credit the equal protection clause mandates that all members should receive credit.
Knapp, 102 Wash.2d at 473-74, 687 P.2d 1145. We find Knapp and the cases cited therein control the outcome of this case.
Under Reanier there is no distinction between pretrial and postconviction confinement. Both Phelan cases reinforce Reanier `s holding. Finally, under Knapp there is no distinction between pretrial, postconviction, and post-imprisonment time spent in a state mental hospital. In this case we find no distinction between defendants under pretrial electronic home detention and defendants under posttrial electronic home detention. Before conviction, defendants are placed under home detention to protect the community and assure their presence at trial. Convicted defendants awaiting the outcome of a criminal appeal are placed under home detention to protect the community and assure their presence at the time their sentences are executed. There is no rational basis to treat these two groups differently.
The State argues the two groups are distinguishable because pretrial defendants have a constitutional presumption of innocence, but postconviction defendants no longer enjoy the same presumption. While the status of each group may be different in terms of their presumption of innocence, the condition of each groupbeing subject to electronic home detentionis identical. Additionally, the reasons for placing a defendant from either group under electronic detention are indistinguishable. Since the Legislature has chosen to grant jail time credit to those who serve pretrial electronic home detention, as recognized by Speaks, equal protection requires the same credit to be granted to those who serve electronic home detention after their conviction and pending their appeal.
The State, citing RCW 9.94A.185, argues Defendant should not receive jail time credit for his home detention because electronic home detention is not statutorily authorized for persons convicted of violent offenses. Despite this, the State apparently acquiesced in the trial court's releasing Defendant to home detention pending his appeal. Whether it was proper to place Defendant on home detention is an entirely separate issue not before this court. Defendant did spend three years on electronic home detention. Having spent the time in detention, Defendant is entitled to credit under the Equal Protection Clause.
We remand this matter to the trial court for recalculation of Defendant's sentence.
SMITH, GUY, JOHNSON, MADSEN, ALEXANDER, TALMADGE and SANDERS, JJ., concur.
DURHAM, Chief Justice (dissenting).
The majority correctly holds that the Defendant is not statutorily entitled to credit for postconviction home detention. Yet, the majority erroneously concludes that it violates equal protection to grant credit for preconviction home detention but not for postconviction home detention. Because a rational basis exists for granting preconviction credit while denying postconviction credit, I respectfully dissent.
The majority's reliance on Reanier v. Smith, 83 Wash.2d 342, 517 P.2d 949 (1974); In re Personal Restraint of Knapp, 102 Wash.2d 466, 687 P.2d 1145 (1984); and State v. Phelan, 100 Wash.2d 508, 671 P.2d 1212 (1983) is misplaced. Each of those cases dealt with the denial of credit for preconviction detention. However, in the present case we are facing the denial of credit for postconviction credit. The burden of home detention relative to the different legal statuses is a sufficiently rational basis for distinguishing between the two groups in the latter context. *587 Before conviction, the Defendant is presumed innocent; therefore, the Legislature may have granted credit for preconviction home detention because of the liberty restriction during this time of presumptive innocence. However, once convicted, the Defendant is considered guilty and is ordinarily expected to remain incarcerated. If he is able to obtain release to home detention, he is receiving an expansion of his liberty and, therefore, reasonably denied the credit he would be entitled to were he to remain incarcerated pending appeal.
A statute is presumptively constitutional and the party challenging it bears the burden of proving its unconstitutionality. State v. Thorne, 129 Wash.2d 736, 769-70, 921 P.2d 514 (1996). Because there is a rational basis for distinguishing between preconviction and postconviction home detention, the Defendant has failed his burden. I would, therefore, affirm the trial court.
