
96 Wn.2d 329 (1981)
635 P.2d 122
In the Matter of the Personal Restraint of KENNETH L. TRAMBITAS and RICHARD D. BLAKESLEY, Petitioners.
No. 47544-0.
The Supreme Court of Washington, En Banc.
October 22, 1981.
Stan Taylor of Institutional Legal Services, for petitioners.
Donald C. Brockett, Prosecuting Attorney, and Richard L. Sayre and Phillip J. Wetzel, Deputies, for respondent.
DORE, J.
Petitioner Kenneth Trambitas appeared in Spokane County Juvenile Court on January 16, 1980, and pleaded guilty to two counts of second degree burglary. Trambitas failed to appear on February 1, the date set for his disposition hearing. He was apprehended and placed in detention on February 7. Additional charges of first degree burglary, second degree burglary, and second degree assault were filed on February 11. A disposition hearing was conducted on February 13 concerning the first set of charges. The court ordered that Trambitas be committed to the Department of Social and Health Services, Division of Juvenile Rehabilitation (DSHS/DJR) for a term of 13 to 16 weeks on each of the two counts, the terms to run consecutively. No credit was given to Trambitas for time which he spent in detention while awaiting disposition. On February 20, Trambitas pleaded not guilty to the second group of charges. Subsequent plea bargaining resulted in his later plea of guilty to the burglary charges and the dismissal of the assault charge. In sentencing on the guilty plea, the *331 court ordered that Trambitas serve 52 to 65 weeks for the second degree burglary and 103 to 129 weeks for the first degree burglary, the terms to run consecutively. The court gave no credit to the defendant for time spent in detention awaiting disposition.
Richard Blakesley was detained in the Spokane County juvenile detention facility from November 9, 1979, through November 12, while law enforcement authorities investigated his role in certain crimes. An information was filed November 21 charging Blakesley with first degree robbery, first degree burglary, and second degree possession of stolen property. Blakesley was again placed in confinement on November 26. He was held in continual detention by court order because it was thought that it was highly probable that he would fail to appear for further proceedings and because he was dangerous to the community at large. On December 4, an amended information was filed adding a fourth count  second degree burglary. On December 18, as a result of plea negotiations, Blakesley pleaded guilty to first degree robbery and the three other counts were dismissed. On December 31, a disposition hearing was held, wherein Blakesley was committed to DSHS/DJR for a standard range term of 103 to 129 weeks. He received no credit against his term of confinement for the time spent in detention prior to the disposition.
Neither Trambitas nor Blakesley appealed the final order of the trial court. They both filed personal restraint petitions which were consolidated for argument before this court. They raise both constitutional and statutory arguments.
We agree with petitioners that the State's failure to credit their dispositions with the time which they spent in pretrial detention violates the United States Constitution. In Reanier v. Smith, 83 Wn.2d 342, 517 P.2d 949 (1974), we held that pretrial detention time served by adults must be credited against maximum and mandatory minimum terms to avoid constitutional violations. We see no reason to deny similar protection to juveniles.
*332 The petitioners argue that the maximum terms to which the credit must be given is the upper end of the standard range imposed. The State disagrees, arguing that the maximum disposition in any juvenile case is the offender's 21st birthday; therefore, as long as the pretrial detention, plus the disposition imposed, will not hold a juvenile past the age of 21, no credit need be given for the prior detention. The State cites In re Quinlivan, 22 Wn. App. 240, 588 P.2d 1210 (1978) to support this proposition.
[1, 2] Petitioners urge the better rule. The maximum sentence against which the credit is to be given is the upper end of the standard range applicable to such offender. In re Quinlivan is not in point. In that case, petitioner requested that pretrial detention time be credited against discretionary minimum sentences set by the Board of Prison Terms and Paroles. The court acknowledged that the detention time had to be credited against the maximum sentence. In re Quinlivan, supra at 244. To hold a juvenile until 21 years of age requires the court to make a finding of "manifest injustice", RCW 13.40.160. This procedure enhances the punishment beyond the maximum. It does not articulate the statutory maximum which is set forth by the standard range guidelines.
Petitioners also assert that due process demands that such credit be given because to do otherwise would constitute punishment without an adjudication of guilt. This violation, petitioners argue, occurs when detention time not credited causes the offender to be detained longer than allowable under the standard range guidelines.
The State contends that the holds placed on petitioners were for the purpose of assuring their continued availability, as opposed to the inability to post bail, as discussed in Reanier. The State also contends that pretrial detention for juveniles is not "punishment"; rather, the juvenile system stresses rehabilitation and intervention. State v. Lawley, 91 Wn.2d 654, 591 P.2d 772 (1979).
It is true that in Reanier we discussed fundamental fairness in relation to an accused's inability to post bail and *333 said that it would be a denial of due process to fail to credit pretrial detention in that case. However, we did not limit our analysis to persons who were detained prior to trial because of indigency. In fact, one of the petitioners before us in that case was held without bail because of the nature of the crime. Reanier, at 344. The distinction raised by the State in the instant case is without merit.
Fundamental fairness ... dictate[s] that an accused person, unable to or precluded from posting bail or otherwise procuring his release from confinement prior to trial should, upon conviction and commitment to a state penal facility, be credited as against a maximum and a mandatory minimum term with all time served in detention prior to trial and sentence. Otherwise, such a person's total time in custody would exceed that of a defendant likewise sentenced but who had been able to obtain pretrial release. Thus, two sets of maximum and mandatory minimum terms would be erected, one for those unable to procure pretrial release from confinement and another for those fortunate enough to obtain such release.... [I]t is clear that the principles of due process ... of the law are breached without rational reason.
(Footnote omitted. Italics ours.) Reanier, at 346-47.
As to the State's argument that pretrial detention does not constitute "punishment", we reiterate what was stated in In re Erickson, 24 Wn. App. 808, 810, 604 P.2d 513 (1979) that "the juvenile disposition order did constitute `punishment for crime'". The restrictions on a person's liberties suffered by pretrial detention is no less "punishment" than that imposed by the disposition order. Reanier, at 351.
We also find that the failure to credit pretrial detention against the maximum sentence violates the juvenile's rights to equal protection, secured through the United States Constitution.
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 time served.
Thus, the juvenile statutory scheme contemplates that *334 credit will be given to some juveniles. Petitioners assert that an impermissible classification occurs if some juveniles and not others receive credit. As stated before in Reanier, we held that credit for time served was mandated whether the reason for the hold was inability to post bond or otherwise. Consequently, the State's argument that only a classification based on indigency of an accused violates the equal protection clause, must fall. As we previously determined with adults, we now find that this disparate treatment among juveniles is impermissible.
[3] Petitioner Trambitas also argues that the sentence imposed on February 28 was enhanced improperly. He argues that the court should not have considered the February 13 offenses because petitioner had no opportunity, after judgment was entered, to reform his behavior before the disposition made on February 28. This is a purely statutory argument and cannot be raised through a personal restraint petition when no appeal was taken; only constitutional issues may be raised at this time. In re Schellong, 94 Wn.2d 314, 616 P.2d 1233 (1980). Likewise, petitioners' other statutory arguments will not be considered.
In conclusion, we find that the time spent by petitioners in detention prior to the imposition of their dispositions should have been credited against the maximum sentence received under the standard range.
We remand both cases to the Superior Court and direct that such credit be given to the respective defendants.
ROSELLINI, UTTER, and WILLIAMS, JJ., concur.
STAFFORD, J., concurs in the result.
DOLLIVER, J. (dissenting)
Kenneth Trambitas and Richard Blakesley seek relief from disposition orders of the Spokane County Juvenile Court. They challenge the court's failure to credit their dispositions with the time they spent in pretrial detention. Neither Trambitas nor Blakesley appealed the juvenile court's disposition orders. Instead, they both filed personal restraint petitions. The majority *335 grants their petitions, holding that the due process and equal protection clauses of the United States Constitution require that credit be given to juveniles for pretrial detention time. I would deny the petitions.
As the majority points out, the petitioners advance both statutory and constitutional arguments. The court has repeatedly stated that a nonconstitutional issue which could have been raised on direct appeal may not be raised for the first time in a personal restraint petition. In re Schellong, 94 Wn.2d 314, 318, 616 P.2d 1233 (1980); State v. Wicke, 91 Wn.2d 638, 645, 591 P.2d 452 (1979); In re Myers, 91 Wn.2d 120, 122, 587 P.2d 532 (1978), cert. denied sub nom. Myers v. Washington, 442 U.S. 912, 61 L.Ed.2d 278, 99 S.Ct. 2828 (1979). Furthermore, the court has held that "those issues, constitutional or nonconstitutional, which were known or could have been known yet were not raised at trial nor on direct appeal, may not be raised on collateral attack." In re Haynes, 95 Wn.2d 648, 651, 628 P.2d 809 (1981). Accord, In re Lee, 95 Wn.2d 357, 363, 623 P.2d 687 (1980); In re Myers, supra. See ABA Standards Relating to Post Conviction Remedies, Std. 6.1(c) (Approved Draft, 1968).
Petitioners had a right of appeal under RCW 13.04.033:
Any person aggrieved by a final order of the [juvenile] court may appeal the order as provided by this section.
The issues petitioners raised were known or should have been known at the disposition hearing, and could have been raised at that time or on appeal. The issues were not raised at the hearings and petitioners failed to exercise their rights of appeal. They should be precluded from raising at this time either constitutional or nonconstitutional objections to the juvenile court's disposition orders.
Even if these procedural rules did not apply, however, there is no constitutional violation involved here.
The Juvenile Justice Act of 1977 places considerable discretion for the imposition of what the trial judge considers to be an appropriate sentence. See In re Schellong, supra. *336 The explicit purpose of the act is to provide for treatment, supervision and custody commensurate with the age, crime and criminal history of the juvenile offender. RCW 13.40.010. The scope of authority which the court has for the disposition of juvenile offenders is found in RCW 13.40.160. Significantly, the sentencing judge is not required in every case to adhere rigidly to the sentencing structure of the act. Where there is a finding that the specified disposition would be a manifest injustice (impose an excessive penalty on the juvenile or a clear danger to society in light of the purposes of RCW 13.40.020(12)), the sentencing judge may diverge from the guidelines suggested by RCW 13.40.160(1), (2) and (4). In such a case, the judge may order commitment to a juvenile correctional institution until the offender's 21st birthday. RCW 13.40.300.
Washington courts have repeatedly ruled that the exercise of discretion in sentencing is not a denial of equal protection. E.g., Jansen v. Morris, 87 Wn.2d 258, 261, 551 P.2d 743 (1976); State v. Blanchey, 75 Wn.2d 926, 939, 454 P.2d 841 (1969); State v. Boggs, 57 Wn.2d 484, 490, 358 P.2d 124 (1961); State v. Nixon, 10 Wn. App. 355, 358, 517 P.2d 212 (1973). In Blanchey, the court distinguished between discretion in choosing the degree of the charge and discretion in fixing the sentence:
[The distinction] results from a meeting of our two goals of treating all men equally in the guilt determination process while retaining some flexibility and individualized treatment at the punishment stage.
Blanchey, at 940.
The federal courts also have voiced their approval of discretionary sentencing. In Williams v. New York, 337 U.S. 241, 93 L.Ed. 1337, 69 S.Ct. 1079 (1949), the United States Supreme Court declared that, "The belief no longer prevails that every offense in a like legal category calls for an identical punishment without regard to the past life and habits of a particular offender." Williams, at 247. The exercise of discretionary power to impose varying sentences does not deny an accused the equal protection of the Fourteenth *337 Amendment. Morrison v. Walker, 404 F.2d 1046, 1048 (9th Cir.1968); Andrus v. Turner, 421 F.2d 290, 292 (10th Cir.1970); Bratton v. Sigler, 235 F. Supp. 448 (D. Neb. 1964). The reasoning in these cases is that allowing discretion enables the sentencing judge to consider such factors as the defendant's background, probable rehabilitation benefits or any extenuating circumstances. Bratton v. Sigler, supra at 449. Accord, Andrus v. Turner, supra at 292. In another context (selective enforcement of recidivist statutes), the Supreme Court suggested that the equal protection clause requires only that discretion not be deliberately based upon an unjustifiable standard such as race, religion or other arbitrary classification. See Oyler v. Boles, 368 U.S. 448, 456, 7 L.Ed.2d 446, 82 S.Ct. 501 (1962).
Several courts have held that it is a denial of equal protection not to grant a prisoner credit for jail time served after he has been unable to meet bail due to indigency when his sentence plus the previous jail time adds up to a total period of incarceration longer than the maximum allowable term prescribed by law for the offense committed. See, e.g., Parker v. Estelle, 498 F.2d 625 (5th Cir.1974); Hook v. Arizona, 496 F.2d 1172 (9th Cir.1974); Hill v. Wainwright, 465 F.2d 414 (5th Cir.1972); Hart v. Henderson, 449 F.2d 183 (5th Cir.1971); Reanier v. Smith, 83 Wn.2d 342, 517 P.2d 949 (1974) (credit on statutory maximum and minimum sentences); In re Young, 32 Cal. App.3d 68, 107 Cal. Rptr. 915 (1973) (credit on minimum sentence). Where a prisoner receives less than the maximum possible sentence, however, the federal courts consistently hold that he is not constitutionally required to receive credit for pretrial detention. Pernell v. Rose, 486 F.2d 301 (6th Cir.1973); Lambdin v. United States, 439 F.2d 1402 (6th Cir.1971); United States v. Whitfield, 411 F.2d 545 (8th Cir.1969); United States v. Deaton, 364 F.2d 820 (6th Cir.1966); Davis v. Parratt, 460 F. Supp. 1227 (D. Neb. 1978). Some courts "conclusively presume" that credit for pretrial detention was given "[w]herever it is possible, as a matter of mechanical calculation, that credit could have *338 been given". Stapf v. United States, 367 F.2d 326, 330 (D.C. Cir.1966). Accord, United States v. Whitfield, supra at 546; Davis v. Parratt, supra at 1233. But see King v. Wyrick, 516 F.2d 321, 325 (8th Cir.1975) (record conclusively demonstrated that jail time credit denied); Padgett v. United States, 387 F.2d 649 (4th Cir.1967) (Stapf presumption rejected).
In the present case, unlike in Reanier v. Smith, supra, relied upon by the majority, the statute under which the petitioners were sentenced did not require a mandatory minimum sentence, and the sentences imposed were less than the statutory maximum (which, under RCW 13.40.300(1), is the offender's twenty-first birthday). Unlike in Reanier, the petitioners' sentences plus the previous detention time did not add up to a total period of incarceration longer than the maximum allowable term prescribed by law for the offense committed. Therefore, the denial of credit for pretrial detention time here was not a violation of the petitioners' rights under the fourteenth amendment of the United States Constitution.
BRACHTENBACH, C.J., and HICKS and DIMMICK, JJ., concur with DOLLIVER, J.
