
37 Wn. App. 269 (1984)
679 P.2d 413
THE STATE OF WASHINGTON, Respondent,
v.
DEBRA COOK, Appellant.
No. 11934-6-I.
The Court of Appeals of Washington, Division One.
April 9, 1984.
*270 Raymond H. Thoenig and Zsa Zsa DePaolo of Washington Appellate Defender Association, for appellant.
Norm Maleng, Prosecuting Attorney, and Kurt Hermanns and Dave Merrell, Deputies, for respondent.
RINGOLD, J.
Debra Cook appeals a juvenile disposition order entered June 15, 1982, for failure to credit her with 12 days of pretrial confinement. The issue is whether pretrial detention time is constitutionally required to be credited to a disposition of community service. We find that credit is constitutionally mandated and remand for redetermination of community service and application of the credit due.
Debra Cook was charged with one count of simple assault, RCW 9A.36.040, and two counts of minor in possession or consumption of liquor, RCW 66.44.270, .290. Cook pleaded not guilty at her arraignment. The juvenile court found that she was a threat to community safety and ordered her detention pending a fact-finding hearing. Cook was in detention for 12 days before the disposition hearing where she was found guilty on all three counts.
Cook was treated as a minor-first offender under RCW 13.40.020. The court did not follow the probation officer's recommended disposition, but ordered 6 months of community supervision and 16 hours of community service on count 1, $25 fines for counts 2 and 3, and counseling and alcohol evaluation. The 12 days of detention were not credited to the disposition order requirements imposed on Cook.
[1] Pretrial detention time must be credited to mandatory minimum and maximum sentences in criminal proceedings. Reanier v. Smith, 83 Wn.2d 342, 517 P.2d 949 (1974); In re Trambitas, 96 Wn.2d 329, 635 P.2d 122 (1981) *271 (credit required in juvenile proceedings). Failure to allow credit violates due process, equal protection, and the prohibition against multiple punishments. In Reanier and Trambitas, part of the rationale was that if credit is not allowed those unable to obtain release pending trial may serve longer sentences than those who are released. Additionally, the total of the pretrial detention time plus the imposed sentence might exceed the statutory maximum penalty if credit is not allowed.
Until the recent case of State v. Phelan, 100 Wn.2d 508, 671 P.2d 1212 (1983), it was uncertain whether credit was constitutionally required when the imposed sentence plus the pretrial detention time did not exceed the maximum possible sentence. Phelan held that, under both equal protection and the double jeopardy clause, all presentence jail time must be credited against "every aspect of a prison sentence," including the discretionary minimum terms required by the sentencing guidelines. Phelan, at 512. The total sentence need not exceed the statutory maximum to invoke the equal protection analysis.
In Phelan, the court reasoned that presentence detention "involves both a deprivation of liberty in addition to that which would otherwise exist, and a classification based solely on wealth ..." and therefore applied an intermediate level of scrutiny in the equal protection analysis. Phelan, at 514. Here we do not face a classification based on wealth because Cook was detained as a potential danger to society, not for inability to post bail.[1] The same level of scrutiny should nonetheless apply. There are still two groups: those able to obtain release pending trial and those unable to do so. Different treatment of the two groups must be justified by a substantial state interest. The Supreme Court has stated that the fundamental fairness analysis of Reanier is not limited to those detained prior to trial because of indigency, and that "The restrictions on a person's *272 liberties suffered by pretrial detention is no less `punishment' than that imposed by the disposition order." Trambitas, at 333.
The State must advance a substantial interest furthered by and justifying different treatment of similarly situated groups. In Phelan, the State argued that credit is not required because the purpose of presentence detention differs from the purpose of detention pursuant to a sentence. The State claimed that presentence detention insures availability for trial, while detention under a sentence is aimed at rehabilitation. Thus, the State argued, different treatment of the two groups is justified by the state interest in rehabilitation. Phelan, at 514.
The Supreme Court rejected this argument, stating that punishment, deterrence, and incapacitation are also major factors behind detention, and that "The connection of a denial of jail time credit with only one of the various goals of discretionary minimum terms is insufficient under the enhanced review applicable here." Phelan, at 514.
Arguably the rehabilitation interest may be more dominant here than in the adult proceedings because of the nature of the disposition which was imposed on Cook as a first time offender: counseling, community service, and fines. Community service, however, is specifically defined in RCW 13.40.020 as punishment for committing an offense and has been held to constitute punishment. In re Erickson, 24 Wn. App. 808, 604 P.2d 513 (1979). As in adult proceedings, a major function of the disposition is punishment. The relation of the State's interest to only one of the functions of the disposition order, here, as in Phelan, does not survive heightened scrutiny.
The next question is whether community service hours may be converted into detention time. The State argues that disparate sanctions cannot be credited absent a legislative directive because the purpose of the disposition will not be served, citing In re Phelan, 97 Wn.2d 590, 647 P.2d 1026 (1982) (Phelan II); and State v. Hultman, 92 Wn.2d 736, 600 P.2d 1291 (1979).
*273 As discussed above, a major function of the community service disposition is punishment. This function is served by the detention. Hultman and Phelan II are not dispositive. The Phelan II court held only that nondetention probationary time need not be credited against detention time after revocation of the suspended sentence. The court relied on the earlier analysis in Hultman, rejecting the argument that one whose suspended sentence is revoked is entitled to credit for the probationary time served. The Hultman court cited RCW 9.95.220 which reads in part: "[i]n the event the judgment has been pronounced by the court and the execution thereof suspended, the court may revoke such suspension, whereupon the judgment shall be in full force and effect ..." The Hultman court reasoned that allowing credit for probationary time is a change in the policy of criminal sentencing which should be made by the Legislature, not by the courts. Hultman, at 743.
Unlike Hultman, allowing credit here does not violate any express legislative policy. There is no statutory authority precluding credit. The juvenile disposition scheme anticipates that credit will be given in at least some cases. RCW 13.40.160(5) provides: "Whenever a juvenile offender is entitled to credit for time spent in detention prior to a dispositional order, the dispositional order shall specifically state the number of days of credit for the time served." The court in Trambitas, at 333-34, cited this statute in recognizing that "the juvenile statutory scheme contemplates that credit will be given to some juveniles."
Furthermore, it is not a question here of crediting nondetention time against later detention, which might be viewed as substituting a less serious sanction for a more serious one. Cook has already served the detention time. She seeks to substitute this time for later imposed community service hours. The Legislature has provided a "conversion table" for the transposition of community service hours and detention time. RCW 13.40.200(3)(b) as amended in 1983, states:

*274 If the violation of the terms of the order under (a) of this subsection is failure to pay fines, penalty assessments, complete community service, or make restitution, the term of confinement imposed under (a) of this subsection shall be assessed at a rate of one day of confinement for each twenty-five dollars or eight hours owed.
Thus this court is not faced with arbitrarily imposing a conversion rate for community service hours and detention time.[2] Although the statute is not specifically intended to apply to pretrial detention credits, it does establish the relative value of the different sanctions.
As a minor-first offender, Cook could not be sentenced to detention time absent a finding of manifest injustice under RCW 13.40.160. Although Phelan requires only that detention time be credited to jail time, the equal protection analysis is the same whether detention time or community service is required by the sentencing disposition. Cook has constitutionally protected interests at stake. If she does not receive credit for the 12 days of detention, she is being treated differently than those who are able to obtain release pending trial. Her disposition is different than it would be had she not been confined pending trial. The Phelan rationale compels the conclusion that the pretrial-day confinement must be credited to the disposition, on the record. Phelan, at 518. It would be incongruous to assert that, because Cook could not be sentenced to detention time, she may not receive credit for her detention time.
This matter is remanded to the trial court for reconsideration of the community service required by the disposition order, with due regard to Cook's entitlement to credit *275 for her pretrial detention time.
SWANSON and SCHOLFIELD, JJ., concur.
NOTES
[1]  There is no right to pretrial release by providing bail under the Juvenile Justice Act of 1977, RCW 13.40.
[2]  Cook did not argue that detention time be credited to the fine portion of her disposition. We therefore do not decide whether pretrial detention must be credited to fines.
