
617 N.W.2d 146 (2000)
2000 SD 127
STATE of South Dakota, Plaintiff and Appellee,
v.
Norval M. SORENSON, Defendant and Appellant.
No. 21186.
Supreme Court of South Dakota.
Considered on Briefs May 30, 2000.
Decided September 13, 2000.
*147 Mark Barnett, Attorney General, Sherri Sundem Wald, Assistant Attorney General, Pierre, for plaintiff and appellee.
Ted W. Hinesley, Edgemont, for defendant and appellant.
PER CURIAM
[¶ 1.] Sorenson appeals from a judgment of conviction of simple assault, third offense, claiming that the trial court abused its discretion when it denied his motion to suppress based on violation of a discovery order and that it erred as a matter of law when it refused him credit on his sentence for time he spent at the Human Services Center undergoing psychiatric evaluation. We affirm.

FACTS AND PROCEDURE
[¶ 2.] Sorenson assaulted Steve Gibson in Sorenson's apartment after the two men had been drinking together. Sorenson was charged with simple assault, third offense. Prior to trial, his attorney filed a motion for discovery of the identity of witnesses to the crime and of all relevant facts, including the identity of witnesses who provided exculpatory information to the State. The motion was granted.
[¶ 3.] During noon recess of the trial, Sorensen's attorney observed Robb Charles, a taxi cab driver, outside the courtroom. Charles was later called as a rebuttal witness by the State and testified to giving Sorensen a ride in his taxi on the day of the assault. Sorensen objected on the grounds that Charles' identity as a witness had not been made known prior to trial during discovery. The prosecutor informed the court that his identity and testimony only became known to the State around 11:00 a.m. the morning of trial, approximately three hours before he was called to testify on rebuttal.[1] The objection was overruled and Sorenson was subsequently found guilty.
[¶ 4.] At the sentencing hearing, it was established that Sorenson had been incarcerated 203 days, with 25 of those days spent undergoing psychiatric evaluation at the Human Services Center (HSC). The trial court sentenced him to two years in the state penitentiary and gave him credit *148 for 178 days served, denying his request for credit for the days spent at HSC. Sorenson appeals.

ANALYSIS AND DECISION
[¶ 5.] 1. Whether the trial court abused its discretion in denying Sorenson's motion to suppress Charles' testimony based on State's violation of the discovery order.
[¶ 6.] SDCL 23A-13-17 sets forth the remedies for breach of a discovery obligation. It provides in pertinent part:
If, at any time during the course of a proceeding, it is brought to the attention of a court that a party has failed to comply with an applicable discovery provision, the court may order such party to permit the discovery or inspection, grant a continuance, or prohibit the party from introducing evidence not disclosed, or it may enter such other order as it deems just under the circumstances.
"Although a trial court's order for the production of evidence must be expeditiously carried out and obeyed, not every failure to produce evidence as ordered is prejudicial error." State v. Oster, 495 N.W.2d 305, 309 (S.D.1993), overruled on other grounds by State v. DeNoyer, 541 N.W.2d 725 (S.D.1995); State v. McKee, 314 N.W.2d 866 (S.D.1982). The trial court's choice of remedy or failure to grant a particular remedy is reviewed under an abuse of discretion standard. State v. Hagan, 1999 SD 119, ¶ 19, 600 N.W.2d 561, 566. Evidentiary rulings are presumed correct and will not be reversed unless there is a clear abuse of discretion. Oster, 495 N.W.2d at 309.
[¶ 7.] Sorenson is presumed to have been aware of this evidence and potential witness prior to trial. After assaulting Gibson, and fearing for Gibson's life, Sorenson walked from his apartment to a local convenience store where he called an ambulance for Gibson and a taxi for himself. Sorenson asked Charles to drive through the alley near his apartment with the taxi's lights off, wait while Sorenson crawled in his apartment window to retrieve a few items, and then drive him and another person to a local bar. En route, Charles overheard Sorenson tell his companion that he "had knocked the shit out of" another person in his apartment.
[¶ 8.] While authorities later looked for Sorenson in the bar, Sorenson called Charles to come back and give him and his friend a ride from the bar. Charles arrived but Sorenson and his friend did not come out. While Charles was inside the bar looking for him, Sorenson slid into the backseat of Charles' taxi. Police found him lying on the backseat and he admitted he was hiding from them. He asked police if the victim in his apartment was dead. When told he was badly beaten, Sorenson replied, "Darn right. I am a fourth generation special forces" and referred to himself as a "killing machine." At trial he explained he said these things in a joking manner to keep the "mood light" and did not expect to be arrested for assault.
[¶ 9.] Discovery statutes exist to eliminate trial by ambush. Oster, 495 N.W.2d at 309. However, Sorenson cannot seriously claim, with this type of extended cab service, that he was unaware of Charles as potentially having information relevant to the crime. Sorenson testified in his own defense regarding the fight and to calling a taxi and being found by the police hiding in the taxi's backseat. He was provided the opportunity to cross-examine Charles.
[¶ 10.] We will not reverse a ruling reviewed under an abuse of discretion standard absent a showing of prejudice. State v. Daniel, 2000 SD 18, ¶ 13, 606 N.W.2d 532, 535. Sorenson must show affirmatively that the State's failure to produce Charles' name as a witness prejudiced the possibility of a fair trial. He has not. The trial court did not abuse its discretion in denying Sorenson's motion to suppress this evidence.
*149 [¶ 11.] 2. Whether the trial court's refusal to credit Sorenson's sentence with 25 days spent at the Human Services Center was a mistake of law.
[¶ 12.] Sorenson originally pled not guilty. Less than a month later, he filed a successful motion for a psychiatric evaluation. The trial court ordered that he be evaluated, at public expense, at the Human Services Center to determine his mental competency at the time of the alleged assault and his ability to assist in his defense at trial. Transportation to and from the facility was provided by the sheriff's office at public expense. Sorenson spent 25 days at HSC undergoing this evaluation. He was successful in changing his plea from not guilty to not guilty by reason of insanity. His motion for bifurcating the guilt/innocence phase and the sanity phase of his trial was granted.
[¶ 13.] Sorenson was found guilty by a jury of simple assault, third offense. His sanity trial was held before Judge Kern who determined that the evidence failed to support either a verdict of not guilty or not guilty by reason of insanity. The maximum sentence that could have been imposed was two years and a $2,000 fine. SDCL 22-18-1, 22-6-1(8). The trial court sentenced Sorenson to two years imprisonment and ordered him to pay court costs, attorney's fees, and restitution. Sorenson was credited for time spent in county jail, but the court refused to award credit for the 25 days he was undergoing psychiatric evaluation at HSC. Sorenson claims the trial court erred in not crediting him for this time.
[¶ 14.] Unless there is some constitutional or statutory limitation, sentencing power is discretionary with the trial judge. State v. Anderson, 1996 SD 46, ¶ 30, 546 N.W.2d 395, 402. There is no statutory right in this state to credit for time served while awaiting trial or sentencing and, in the absence of a statute to the contrary, the traditional rule is to deny such credit. See Annotation, Right to Credit for Time Spent in Custody Prior to Trial or Sentence, 77 A.L.R.3d 182, 190 (1997 & Supp. 1999). The rationale is that "the confinement simply does not relate in any way to the subsequent punishment imposed." Id. at 188.
[¶ 15.] However, where incarceration results from a defendant's financial inability and failure to post bond, the traditional rule denying credit for presentence confinement does not apply. "`The Fourteenth Amendment equal protection clause requires that credit be given for all presentence custody which results from indigency.'" State v. Green, 524 N.W.2d 613, 614 (S.D.1994) (quoting Patino v. State, 331 N.W.2d 837, 838 (S.D.1983)); State v. Rederth, 376 N.W.2d 579 (S.D. 1985); State v. Graycek, 335 N.W.2d 572 (S.D.1983); State v. Cody, 323 N.W.2d 863 (S.D.1982).[2] "The appointment of counsel is sufficient to establish a defendant as indigent prior to sentencing, and such indigency dates from the time the court approves an application for court-appointed counsel. In addition, the inability of defendant to post bail while awaiting trial is also an indication of presentence indigency." Green, 524 N.W.2d at 614 (internal citations omitted).
[¶ 16.] Several jurisdictions have addressed the issue of credit for presentence custody in locations other than jail. By statute, Iowa grants credit for time spent undergoing psychiatric evaluation during presentence custody where the defendant fails to furnish bail or is charged with a nonbailable offense. State v. Capper, 539 N.W.2d 361 (Iowa 1995) (remanding to trial court to modify sentence to include time spent by defendant undergoing mental competency examination). Also by statute, Wisconsin allows credit for presentence *150 custody where the defendant is in "constructive custody" subject to court order while "temporarily outside the institution whether for the purpose of ... medical care." State v. Sevelin, 204 Wis.2d 127, 554 N.W.2d 521 (1996) (recognizing alcoholism as a disease and remanding to trial court to credit defendant for 82 days spent at inpatient substance abuse treatment centers prior to his conviction). Sevelin noted that a defendant would not receive credit if released on bond before leaving for the treatment facility. Id. at 524, n.6.
[¶ 17.] As previously noted, South Dakota has no statute regarding credit for time spent prior to sentencing, whether that time is spent in jail or another location. However, it follows from application of the rule set forth in Green, based on equal protection rights under the Fourteenth Amendment, that a defendant must be credited for time spent in a hospital for psychiatric evaluation while awaiting trial or sentencing if he remained in state custody during that time and his confinement was attributable to his indigency status. But for the hospitalization, such a defendant would still be incarcerated due to his financial inability to post bail. SDCL 23A-46-1, relating to the mental examination of criminal defendants, provides in pertinent part that "the court may commit the person to be examined for a reasonable period to the custody of a suitable facility." (emphasis added). Form 13 in the Appendix of Forms following SDCL ch. 23A-46 indicates the defendant remains under state custody at all times pertinent to the evaluation, including transport time to and from the facility.
[¶ 18.] A defendant who is not indigent does not fall under the rule set forth in Green and need not be credited for time spent undergoing psychiatric evaluation, whether incarcerated or released on bail during that time. This is in keeping with the traditional rule that, absent a contrary statutory rule, a defendant does not have a right to credit for time spent in custody prior to trial or sentencing. In South Dakota, there is no contrary statutory rule and the sentencing court enjoys broad discretion in fashioning an appropriate sentence.
[¶ 19.] A defendant's indigency status at the time of transfer for a court-ordered mental evaluation is a question of fact to be determined by the trial court. This record shows that on January 15, 1999, Sorenson's application for appointment of counsel due to indigency was approved and counsel duly appointed. Bond was set at $20,000. On February 4, 1999, Sorenson was able to post $2,000 for his release on bail prior to trial. In Green, this Court noted the inability to post bail was an indication of indigency. 524 N.W.2d at 614. While free on bail, Sorenson failed to timely appear at a February 12 motion hearing. His bond was forfeited on that date and he was returned to jail.[3]
[¶ 20.] On February 19, Sorenson filed a motion for a psychiatric evaluation at HSC. One week later, the court granted his motion. The evaluation occurred after Sorenson had been returned to jail and his bond revoked for failure to timely appear at the motion hearing. On June 17, Sorenson filed a motion for reduction of his bond amount to $250. There is no record the court took any action on this motion.
[¶ 21.] Notwithstanding the question of Sorenson's indigency status and the issue of equal protection, there is another factor affecting his claim that the court erred in failing to award credit for his time spent at HSCwhether Sorenson was eligible for release following revocation of his bond. SDCL 23A-43-21 provides:

*151 Upon a showing that there has been a material breach of a condition of release without good cause, the court shall declare a forfeiture of the bond, if any, and shall enter an order revoking the conditions of release. If the defendant is not in custody, the court shall direct the clerk to issue a warrant for the defendant's arrest. The defendant shall remain in custody until discharged by due course of law.

(emphasis added).
[¶ 22.] In Smith v. State, 988 P.2d 39, 40 (Wyo.1999), the Wyoming Supreme Court acknowledged the rule expressed in Green and the equal protection provided an indigent defendant in awarding credit for presentence custody. However, the court held that "[a] defendant is not ... entitled to credit for the time that he spent in custody when his confinement would have continued despite his ability to post bond." Id. (citations omitted).[4] Smith was not awarded credit on his sentence for time spent in presentence custody after his bond had been revoked and he was returned to jail. He was only credited for the 20 days he spent in jail from his initial arrest until he was released on bond. He was free on bond for six weeks until he violated one of the conditions of his release and was arrested. The time Smith spent in jail following this arrest and prior to his sentencing was not credited. Id.
[¶ 23.] Similar facts exist here. Sorenson was released on bail but returned to jail one week later when he failed to appear on time at a motion hearing. His bond was revoked at that time. Pursuant to SDCL 23A-43-21, he was not eligible for release after February 12, whether or not he had the financial ability to post bail. This moots the question of credit for time spent at HSC after this date as his confinement was not attributable to his financial ability to post bond. The sentencing court, in its discretion, awarded Sorenson credit for all of the time he was in presentence custody, excluding only the 25 days of evaluation at HSC.
[¶ 24.] As sentencing courts in this state enjoy broad discretion within statutory and constitutional limitations in fashioning appropriate sentences, Anderson, supra, Sorenson's equal protection rights were not impinged when he was confined following revocation of his bond. We find no mistake of law and affirm.
[¶ 25.] MILLER, Chief Justice, and SABERS, AMUNDSON, KONENKAMP and GILBERTSON, Justices, participating.
NOTES
[1]  Although Charles testified he was interviewed by police the day of the assault, no written report of his statement was found to exist.
[2]  The rule applies in all cases involving sentences less than life. Green, supra; State v. Hill, 255 Neb. 173, 583 N.W.2d 20 (1998).
[3]  The record shows Sorenson called the clerk's office fifteen minutes prior to commencement of the hearing to indicate he would be late. He arrived at the courthouse thirty-five minutes after his hearing began. His bond was immediately forfeited and he submitted himself to the custody of the sheriff. He was later successful in obtaining an order to set aside enforcement of the forfeiture and have the bond revoked instead.
[4]  Other jurisdictions follow this same rule. See State v. Williams, 59 Wash.App. 379, 796 P.2d 1301 (1990) (no equal protection concerns arise where presentence confinement was not solely on robbery charge but also because parole was suspended as a result of defendant's arrest); People v. Davis, 187 Cal. App.3d 1250, 232 Cal.Rptr. 428 (1986) (no equal protection violation for denial of presentence credit where defendant was awaiting sentence on possession of methamphetamine charge and had an outstanding no-bail bench warrant for failure to appear for sentencing in a prior case); State v. San Miguel, 132 Ariz. 57, 643 P.2d 1027 (1982) (defendant entitled to credit for time spent in presentence confinement where he was unable to make bond, but not entitled to credit for time spent not related to his indigency where he was being held without bond).
