
986 S.W.2d 486 (1999)
Daniel BATES, Appellant,
v.
MISSOURI DEPARTMENT OF CORRECTIONS, Respondent.
No. WD 56291.
Missouri Court of Appeals, Western District.
January 26, 1999.
*487 Daniel Bates, pro se.
Jeremiah W. (Jay) Nixon, Atty. Gen., Michael J. Spillane, Asst. Atty. Gen., Jefferson City, for Respondent.
Before ULRICH, P.J., and SMART and EDWIN H. SMITH, JJ.
EDWIN H. SMITH, Justice.
Daniel Bates appeals the circuit court's judgment denying his petition against the respondent, the Missouri Department of Corrections (the DOC), for declaratory judgment and injunctive relief wherein he alleged that he was entitled to credit against his prison sentences for the time he was free on bond while under house arrest and awaiting trial.
The appellant raises two points on appeal. He claims that it was error to deny him credit against his sentences for the time he was free on bond because: (1) as a matter of law, he was entitled to such credit in that, even though he was not actually in jail or custody awaiting trial, the conditions of his bond were so restrictive as to be tantamount to being in jail or custody, requiring credit pursuant to § 558.031;[1] and (2) it was a denial of equal protection in that prisoners who are released from the DOC and placed under house arrest receive credit against their prison sentences.
We affirm.

Facts
The appellant was convicted in the Circuit Court of St. Charles County of the class C felony of felonious restraint, § 565.120; the class B felony of armed criminal action, § 571.015; and the class A misdemeanor of assault in the third degree, § 565.070. As a consequence, on August 7, 1997, he was sentenced to concurrent sentences of five years imprisonment on each felony conviction and one year on the misdemeanor conviction. In serving his sentences, he was initially incarcerated in the Algoa Correctional Center in Jefferson City, but was subsequently transferred to the Maryville Treatment Center in Maryville, where he is currently incarcerated.
The appellant was arrested on January 4, 1996. He was immediately taken to St. Joseph's Hospital in St. Charles for treatment of a gunshot wound suffered during his arrest. He remained in the hospital under the *488 custody of the St. Charles Sheriff's Department until January 12, 1996, when he was transferred to the Missouri Department of Mental Health (the DMH) in Fulton for psychiatric evaluation. On January 29, 1996, he was transferred to the St. Charles County Jail to await trial.
On January 30, 1996, the appellant posted bond. As conditions of his release, he was placed under house arrest and prohibited from consuming alcohol, entering any establishment that served or sold alcohol, and possessing firearms. Under the terms of his house arrest, the appellant was required to be under the supervision of at least one of six named persons at all times and to wear an electronic bracelet, which prevented him from moving beyond 100 feet from his home, other than for outpatient treatment and counseling. To permit him to continue working, he was allowed to leave his home from 6:00 a.m. to 3:30 p.m., five days a week, commencing in May 1996. He remained under house arrest, subject to these restrictions, from January 30, 1996, through June 26, 1997.
On February 26, 1998, while serving his sentences, the appellant filed a petition for declaratory judgment and injunctive relief in the Circuit Court of Cole County. In his petition, he sought a declaration that he was entitled to credit against his prison sentences for the time he spent in St. Joseph's Hospital, the DMH, and under house arrest. On May 20, 1998, the records officer of the Algoa Correctional Center credited against the appellant's sentences the time he spent in the hospital and in the custody of the DMH. On or about July 27, 1998, the trial court, the Honorable Byron L. Kinder, finding that the appellant had previously received credit against his sentences for the period between January 4, 1996, and January 29, 1996, and was not entitled to credit against his sentences for the time he spent under house arrest from January 30, 1996, to June 26, 1997, denied his petition for declaratory judgment and injunctive relief.
This appeal follows.

Standard of Review
"In an action for declaratory judgment tried before a court without a jury, the judgment entered by the trial court will be affirmed unless there is no substantial evidence to support it, it is against the weight of the evidence, or the court erroneously declared or applied the law." Local 781 Int'l Ass'n of Fire Fighters v. City of Independence, 947 S.W.2d 456, 459 (Mo.App.1997).

I.
In his first point, the appellant claims that the trial court erred in determining that he was not entitled to credit against his prison sentences for the time he was free on bond while under house arrest and awaiting trial, because as a matter of law he was entitled to such credit in that, even though he was not actually in jail or custody while awaiting trial, the conditions of his bond were so restrictive as to be tantamount to being in jail or custody, requiring credit pursuant to § 558.031. This section governs when a person convicted of a crime and sentenced to imprisonment can receive credit against his or her sentence and reads, in pertinent part, as follows:
Calculation of terms of imprisonment-credit for jail time awaiting trial.
1. A sentence of imprisonment shall commence when a person convicted of a crime in this state is received into the custody of the department of corrections or other place of confinement where the offender is sentenced. Such person shall receive credit toward the service of a sentence of imprisonment for all time in prison, jail or custody after the offense occurred and before the commencement of the sentence....
§ 558.031 (emphasis added).
"As a matter of law, claims for credit for time served under section 558.031 are not cognizable." Mashek v. State ex rel. Mitchell, 940 S.W.2d 1, 2 (Mo.App.1997) (footnote omitted). A prisoner seeking credit towards service of his or her sentence must request such from the DOC because the statute contemplates an administrative, not a judicial, determination of time to be credited *489 against a sentence. Id.(citing Murphy v. State, 873 S.W.2d 231, 232 (Mo. banc 1994)). A prisoner can, however, file a petition for declaratory judgment seeking a determination by a court that he or she is entitled to credit toward the completion of his or her sentence pursuant to this section. Id. The statute does not strip a court of its authority to declare the rights of the prisoner but only prohibits the court from calculating and crediting against a sentence any time served. Id. at 2-3. Thus, the trial court here had the authority to determine whether the appellant was entitled to credit. Id. Any time required to be credited, however, would have to be calculated and recorded by the DOC. Murphy, 873 S.W.2d at 232.
The law is well settled that criminal defendants are entitled to receive credit against their prison sentences for time actually spent in jail or custody awaiting trial, but are not entitled to credit for time spent awaiting trial free on bail. See § 558.031; Mashek, 940 S.W.2d at 3; Amsden v. State, 699 S.W.2d 54, 57 (Mo.App.1985); State v. Leftridge, 634 S.W.2d 233, 233 (Mo.App. 1982); State v. Carr, 567 S.W.2d 422, 423 (Mo.App.1978); Beaver v. State, 543 S.W.2d 787, 788 (Mo.App.1976). A defendant who is on bond is not in jail or custody, and the law does not allow credit against a sentence for time spent free on bail. Carr, 567 S.W.2d at 423. Accordingly, the appellant here would not be entitled to the credit against his sentences he sought in the proceeding below, unless we accept his argument that while on bond awaiting trial he was effectively in jail or custody due to the restrictive conditions of his bond. This argument is predicated on the appellant's contention that the nature of his confinement, and not the place, should control whether, pursuant to § 558.031, he is entitled to credit against his sentences.
In making his claim in Point I, the appellant relies on Hart v. State, 588 S.W.2d 226 (Mo.App.1979) and Heitman v. State, 622 S.W.2d 760 (Mo.App.1981). In Hart, the defendant, while on bond awaiting trial, was confined to a locked ward in a hospital to determine his mental state. Hart, 588 S.W.2d at 228. After his conviction, he filed a "Motion to Modify Court Order" requesting credit for the time he spent in the hospital. Id. at 227. The trial court summarily dismissed the motion. Id. This court affirmed the dismissal because it was determined that the motion was not made in the proper form, and, as a result, the issue of whether the defendant was entitled to credit against his sentence was never decided. Id. at 228. However, the court did note, in dicta, that the nature of the defendant's confinement, rather than the place, should determine whether he or she is entitled to credit against his or her sentence for the time confined. Id.
In Heitman, the defendant was free on bond while awaiting trial but was restricted to his residence between the hours of 10:00 p.m. and 6:00 a.m. and was required to report to a sheriff at 10:00 p.m. every night to confirm his compliance. Heitman, 622 S.W.2d at 760. Relying on the dicta in Hart, the defendant argued that he was entitled to credit against his sentence for the time spent on bond because the conditions of his bond were so restrictive as to be the equivalent of incarceration. Although the Heitman court acknowledged that Hart left open the question of whether bail conditions could be so restrictive as to equate to being in custody for credit purposes pursuant to § 558.031, the court found that Hart was not authoritative in that the issue was not ripe for pronouncement in that case. Id. at 761. The court found further that, even if it accepted, as fact, that bond conditions could be so restrictive as to be tantamount to being in custody, requiring credit against a sentence pursuant to § 558.031, the conditions of Heitman's bond were clearly not so restrictive. Id. Thus, the court held that he would not be entitled to credit against his sentence in any event. Id.
Our reading of § 558.031 convinces us that only time actually spent in prison, jail or custody is to be credited toward a sentence of imprisonment. § 558.031.1; Mashek, 940 S.W.2d at 3. There is no dispute that the appellant here was not actually in jail or custody during the time he was free on bond while under house arrest awaiting trial. As such, the appellant was not entitled to § 558.031 credit for this time.
*490 Even assuming, arguendo, that a jail or custody equivalency test should be adopted, as the appellant suggests, recognizing that bond conditions could be so restrictive as to be the equivalent of being in jail or custody, requiring credit pursuant to § 558.031 against a defendant's sentence, the appellant's claim would still fail in that the conditions of his bond, although slightly more restrictive, were very similar to those placed on the defendant in Heitman, where credit was denied. In the instant case, the appellant, while under house arrest, was free to move about and enjoy all the comforts of his home. Further, commencing in May 1996, he was allowed to leave his home from 6:00 a.m. to 3:30 p.m., five days a week, to work. As such, the conditions of the appellant's bond were not so restrictive as to render them the equivalent of being in jail or custody requiring § 558.031 credit.
For the reasons stated, we find that the trial court did not err in determining that the appellant was not entitled to § 558.031 credit against his prison sentences for the time he spent free on bail while under house arrest and awaiting trial.
Point denied.

II.
In his second point, the appellant claims that it was error to deny him credit against his sentences for the time he was free on bond while under house arrest and awaiting trial, because it was a violation of equal protection in that prisoners who are released from the DOC and placed under house arrest receive credit against their sentences. In making this claim, the appellant argues that the respondent established and administers a house arrest program which allows certain prisoners to move freely about the community between the hours of 6:00 a.m. and 11:00 p.m., while receiving credit against their sentences for the time spent participating in the program. As such, he argues that by denying him credit against his sentences, while subject to much more restrictive conditions than those prisoners participating in the program, the respondent treats him differently for no legitimate reason, thereby denying him the equal protection of the law. We disagree.
"When considering claims that a law violates the Equal Protection Clause, the first step is to determine whether the statutory scheme `operates to the disadvantage of some suspect class or impinges upon a fundamental right explicitly or implicitly protected by the Constitution.'" Missourians for Tax Justice Educ. Project v. Holden, 959 S.W.2d 100, 103 (Mo.1997), cert. denied, ___ U.S. ___, 118 S.Ct. 2298, 141 L.Ed.2d 158 (1998) (quoting San Antonio Indep. School Dist. v. Rodriguez, 411 U.S. 1, 17, 93 S.Ct. 1278, 1288, 36 L.Ed.2d 16, 33 (1973)). If the statute involves a suspect class or a fundamental right, then it receives strict scrutiny to determine whether the classification is necessary to accomplish a compelling state interest. Id. If it does not, the only issue is whether the classification is rationally related to a legitimate state interest. Id.
A suspect class is one that because of historical reasons "`command[s] extraordinary protection from the majoritarian political process.'" Casualty Reciprocal Exch. v. Missouri Employers Mut. Ins. Co., 956 S.W.2d 249, 256 (Mo. banc 1997) (quoting Massachusetts Bd. of Retirement v. Murgia, 427 U.S. 307, 313, 96 S.Ct. 2562, 2567, 49 L.Ed.2d 520, 525 (1976)). Fundamental rights include the rights to free speech, to vote, to freedom of interstate travel, as well as to other basic liberties. Id. The classification the appellant challenges here, between inmates under house arrest postconviction and defendants under house arrest pre-trial, does not involve a suspect class or a fundamental right. As such, it will only be reviewed to determine whether it is rationally related to a legitimate state interest. Holden, 959 S.W.2d at 103. The burden is on the person attacking the classification to show that it does not rest upon any reasonable basis. Id. A classification does not violate equal protection if any state of facts can be reasonably conceived that would justify it. Id.
Section 217.541 authorizes the DOC, at its discretion, to extend the limits of confinement for offenders serving sentences for class C or D felonies who have one year or *491 less remaining prior to release. The statute provides that inmates released under the house arrest program may leave their residences only for the purposes of participating in work, educational or vocational programs, and other activities that may be necessary for their supervision and treatment. § 217.541. The statute does not, as the appellant contends, allow the inmates to move freely about the community. The State claims that a legitimate purpose of this statute is to reacclimate to the community offenders preparing for imminent release, while keeping them subject to the supervision of the DOC, thereby increasing the likelihood of a successful transition into the community upon unconditional release. We believe that this is a legitimate state purpose, and that § 217.541 is rationally related to its accomplishment. This purpose would not be served by crediting against a subsequently imposed sentence the time a defendant is free on bond, while under house arrest and awaiting trial. As such, we find that it does not violate the equal protection clause to allow inmates credit against their sentences for time spent in postconviction house arrest programs, while denying the same credit to defendants under house arrest pre-trial. Given this fact, we cannot convict the trial court of error in concluding that the appellant was not entitled to receive credit against his prison sentences for the time he spent free on bond.
Point denied.

Conclusion
The judgment of the circuit court denying the appellant's petition for declaratory judgment and injunctive relief is affirmed.
All concur.
NOTES
[1]  All references to § 558.031 are to RSMo Supp. 1997. All other statutory references are to RSMo 1994, unless otherwise indicated.
