
902 So.2d 890 (2005)
J.I.S., a Child, Appellant,
v.
STATE of Florida, Appellee.
No. 1D04-4379.
District Court of Appeal of Florida, First District.
May 31, 2005.
Nancy A. Daniels, Public Defender, and P. Douglas Brinkmeyer, Assistant Public Defender, Tallahassee, for Appellant.
Charlie Crist, Attorney General, and Trisha Meggs Pate, Assistant Attorney General, Tallahassee, for Appellee.
HAWKES, J.
Appellant, a juvenile, appeals the trial court's denial of his motion for credit for time he spent in secured detention, awaiting disposition. Appellant's disposition (as distinguished from a sentence) required he be committed to a high risk program. Appellant could complete his program in nine months, eighteen months, or longer, depending upon how he responded. Thus, his commitment was for an indeterminate length of time. We affirm for two reasons.
We begin by noting that, as a practical matter, since juveniles are committed for indeterminate lengths of time, it is "generally impossible to fix a date from which to deduct time spent in secure detention." C.C. v. State, 841 So.2d 657, 658-659 (Fla. 4th DCA 2003). Consequently, an award of credit for time served in secure detention would have no effect on the length of a juvenile's commitment, and would be a futile exercise and a waste of judicial resources.
Second, we note the policy reasons that support the concept of credit for time *891 served are not present in the juvenile context. Credit for time served is a concept that arises in a punitive context, where an offender suffers a loss of liberty for a defined period of time, as punishment as part of a criminal sentence. In that context, the length of an incarcerative portion of a sentence is not random or arbitrary. It is the product of a deliberative process by a court of competent jurisdiction. Thus, if the court determines an offender deserves a specific period of time of incarceration as part of the sentence, it makes logical sense, and is supportive of the deliberative process, to give the offender credit for any time for which he had already suffered a loss of liberty prior to his sentencing. Allowing the credit results in the offender suffering a loss of liberty only for the length of time the court determined was appropriate.
The authorization for giving a criminal defendant credit for time served is legislative in origin. See § 921.161(1), Fla. Stat. (2004); C.C., 841 So.2d at 658. However, "no such provision exists in Chapter 985 or in the Florida Rules of Juvenile Procedure." C.C. 841 So.2d at 658. Thus, "giving juveniles credit for time served in secure detention was born of judicial interpretation." Id.
It appears only the Second and Fourth District Courts of Appeal have addressed the issue of juvenile entitlement to credit for time served outside the jurisdictional context.[1] In E.R. v. State, 584 So.2d 158 (Fla. 2d DCA 1991), the Second District held juveniles are entitled to credit for time spent in secure detention. The Fourth District followed the Second in also concluding juveniles are entitled to credit for time spent in secure detention. See L.K. v. State, 729 So.2d 1011 (Fla. 4th DCA 1999); J.B. v. State, 829 So.2d 376 (Fla. 4th DCA 2002); C.C., 841 So.2d at 658.
In reaching its holding, the Second relied upon the Florida Supreme Court's reasoning in Tal-Mason v. State, 515 So.2d 738 (Fla.1987). We believe the Second misconstrued Tal-Mason. In Tal-Mason, the Court reviewed the issue of "credit for time served" in the context of whether time spent in a mental institution as a result of an involuntary commitment for incompetency should be credited against a subsequent prison sentence. The Court concluded a defendant would get credit for time served in this context, reasoning detention in a mental institution for incompetence to stand trial constituted a coercive deprivation of liberty and implicated significant constitutional rights, just as would a defendant's incarceration in jail awaiting trial. The Court held that to deny jail-time credit for this type of detention while granting it for others would constitute a violation of equal protection and a denial of due process. See id. at 740.
In Tal-Mason, the offender was initially committed to receive treatment, then later sentenced to incarceration for a specific period of time. Thus, in that case, granting credit for time served would achieve its goal. The defendant only served, and was coercively denied a liberty interest, for the period of time the court, through its deliberative sentencing process, determined to be appropriate. Logically, Tal-Mason would only be applicable in a juvenile context if the juvenile was committed to a *892 program for treatment and then, perhaps as a consequence of failing to complete the program, was sentenced, as punishment, for a defined period of incarceration.
However, in the juvenile context, that situation is not present. The juvenile justice system is designed to rehabilitate the offender. See C.C., 841 So.2d at 658. Rehabilitation can be analogized to treatment. Since the juvenile justice system is designed to rehabilitate offenders, a juvenile's disposition is for treatment, not punishment. That treatment or rehabilitative effort may take longer in some situations than in others. The time required depends on how well the juvenile responds. Accordingly, the rationale for awarding credit for time served is not applicable in the juvenile context. See In the Interest of B.A., 546 So.2d 125 (Fla. 1st DCA 1989) (holding that, considering rehabilitative purpose of chapter 39, Florida Statutes, there is no basis to conclude juvenile entitled to credit for time served in secure detention against community control sentence).
For the foregoing reasons, juveniles whose dispositions are to indeterminate commitment programs are not entitled to credit for time served in secure detention. The trial court's order denying Appellant credit for time served in secure detention is AFFIRMED.
To the extent our opinion conflicts with E.R. v. State, 584 So.2d 158 (Fla. 2d DCA 1991), L.K. v. State, 729 So.2d 1011 (Fla. 4th DCA 1999), J.B. v. State, 829 So.2d 376 (Fla. 4th DCA 2002), and C.C. v. State, 841 So.2d 657 (Fla. 4th DCA 2003), we certify conflict.
BARFIELD, J., concurs, and BENTON, J., concurs in judgment with opinion.
BENTON, J., concurring in the judgment.
After his arrest on May 17, 2004, J.I.S. was in secure detention until his "commitment to a high risk residential program (level eight)," C.T. v. State, 816 So.2d 757, 758 (Fla. 4th DCA 2002), on September 1, 2004. Seventeen years old, he was adjudicated delinquent for what would have been a second-degree felony (lewd or lascivious battery in violation of section 800.04(4), Fla. Stat. (2003)), punishable by imprisonment for up to fifteen years, if he had been an adult at the time of the offense. § 775.082(3)(c), Fla. Stat. (2003).
In the disposition order, the court "retain[ed] jurisdiction over [J.I.S. because he was] a child committed to the department for placement ... in a high-risk ... residential commitment program to allow [him] to participate in a juvenile conditional release program ... [but not] beyond [his] 22nd birthday." § 985.201(4)(b)(1.), Fla. Stat. (2003). See also § 985.231(1)(a)(10.), Fla. Stat. (2003) ("Any commitment of a juvenile sexual offender to a program or facility for juvenile sexual offenders must be for an indeterminate period of time, but the time may not exceed the maximum term of imprisonment that an adult may serve for the same offense. The court may retain jurisdiction over a juvenile sexual offender until the juvenile sexual offender reaches the age of 21, specifically for the purpose of completing the program.").
In these circumstances, as the majority opinion explains, J.I.S.'s time in secure detention has no legal bearing on the date he must be discharged from the residential program or from any conditional release program thereafter. That is why I join the judgment.
In a case of simple battery, however  to take one example  a juvenile's spending three and a half months in custody before *893 entry of the disposition order might well determine the date he must be released from custody. See § 775.082(4)(a), Fla. Stat. (2003) (authorizing as punishment for "a misdemeanor of the first degree, . . . a definite term of imprisonment not exceeding 1 year"); § 784.03(1), Fla. Stat. (2003) (proscribing simple battery as a misdemeanor of the first degree). And it is even possible that an adjudication of delinquency under section 800.04(4) (lewd or lascivious battery) might be reduced to an adjudication of delinquency under section 784.03(1) (simple battery) on appeal. See § 924.34, Fla. Stat. (2003).
The better practice, in my view, is for the trial judge to note in the disposition order any time the juvenile has already spent in confinement. Making such a finding would prove useful in some cases and should not prove anti-therapeutic in any. See In re Gault, 387 U.S. 1, 26, 87 S.Ct. 1428, 18 L.Ed.2d 527 (1967) (noting "suggest[ion] that the appearance as well as the actuality of fairness, impartiality and orderliness ... may be a more impressive and more therapeutic attitude so far as the juvenile is concerned").
NOTES
[1]  See e.g., C.B. v. State, 729 So.2d 538 (Fla. 1st DCA 1999) (holding juvenile could not be committed for a period beyond one year or his 19th birthday, whichever came first); D.L.J. v. State, 765 So.2d 740 (Fla. 1st DCA 2000) (holding disposition in juvenile case is limited to the maximum sentence that could be imposed upon an adult for the same offense).
