
13 Cal.App.4th 1401 (1993)
16 Cal. Rptr.2d 830
THE PEOPLE, Plaintiff and Respondent,
v.
CHARLES PHILIP LATHROP, Defendant and Appellant.
Docket No. G012292.
Court of Appeals of California, Fourth District, Division Three.
February 26, 1993.
*1402 COUNSEL
Leslie C. Greenbaum, under appointment by the Court of Appeal, for Defendant and Appellant.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Gary W. Schons, Assistant Attorney General, and Rhonda L. Cartwright, Deputy Attorney General, for Plaintiff and Respondent.
OPINION
SONENSHINE, J.
Charles Philip Lathrop appeals the trial court's denial of presentence credits in imposing a 16-month prison sentence for his drunk driving conviction. We affirm the judgment of conviction, but remand to allow a proper award of credits.
On May 17, 1991, Lathrop was arrested in Riverside County on an assault charge and bail was set at $20,000. The same day, Orange County placed a *1403 "hold" on him for this case, and bail was set at $10,000. On October 28, Lathrop was transported to Orange County jail. The Riverside case was deferred pending resolution of this case.
On January 14, 1992, Lathrop pleaded guilty on this case and the trial court sentenced him to 16 months in prison. The court refused to award any presentence custody credits, reasoning, "Mr. Lathrop is not entitled to any credit in the Orange County case, because he's been in custody in the Riverside case. And, in fact, when the Riverside court sentences him, if the Riverside court sentences him, he will then be entitled to custody from the time of his arrest, until the time of his sentence."[1]

DISCUSSION
Penal Code section 2900.5, subdivision (a) provides, in pertinent part, that "when [a] defendant has been in custody ... all days of custody ... shall be credited upon his or her term of imprisonment...." Subdivision (b) specifies, "For the purposes of this section, credit shall be given only where the custody to be credited is attributable to proceedings related to the same conduct for which the defendant has been convicted."
(1a) The parties concede this case is governed by In re Joyner, supra, 48 Cal.3d 487, although they disagree on what it held and on its application to these facts. Joyner sought presentence custody credits on a California prison term ordered to be served concurrent to a previously imposed Florida prison term for unrelated offenses. He argued he was entitled to credits "from the date a `hold' was placed against him for the California offenses until he was sentenced in California, all of which time has already been credited against petitioner's Florida sentence." (Id. at p. 489, italics added.)
The Supreme Court declared: "We hold that a period of time previously credited against a sentence for unrelated offenses cannot be deemed `attributable to proceedings' resulting in a later-imposed sentence unless it is demonstrated that the claimant would have been at liberty during the period were it not for a restraint relating to the proceedings resulting in the later sentence. In other words, duplicative credits against separately imposed concurrent sentences for unrelated offenses will be granted only on a showing of strict causation." (48 Cal.3d at p. 489.)
Lathrop correctly points out that his case, unlike Joyner's, does not involve duplicative credits because he was not sentenced on the Riverside *1404 case. The period of presentence detention was not "previously credited against a sentence for unrelated offenses...." (In re Joyner, supra, 48 Cal.3d at p. 489.)
Joyner involved the converse scenario to Lathrop's and it provided the factual predicate for the rule.[2] No problem regarding duplicative credits arises until the second sentence is imposed. We are directed to no case purporting to deal with the problem at the time of the first sentencing hearing. (See, e.g., In re Bustos (1992) 4 Cal. App.4th 851, 855 [5 Cal. Rptr.2d 767] [duplicative credit issue]; In re Nickles (1991) 231 Cal. App.3d 415, 417-424 [282 Cal. Rptr. 411] [same]; People v. Odom (1989) 211 Cal. App.3d 907, 910 [same] [259 Cal. Rptr. 827].)
Indeed, that is for good reason. Substantial difficulties could arise otherwise. Suppose that after the Orange County matter was resolved, the charges in Riverside were dismissed. He would not receive any credit, even though his custody was "attributable" to this case as of May 17, 1991. (2) One purpose behind Penal Code section 2900.5 is to equalize the time actually served by defendants convicted of the same offense. (People v. Riolo (1983) 33 Cal.3d 223, 228 [188 Cal. Rptr. 371, 655 P.2d 723].) (1b) That purpose would be frustrated in the situation we hypothesize because Lathrop would not receive the same credits as other prisoners sentenced for the same crime, simply because he had first gone into custody on charges which were ultimately dismissed.
This case is also unlike In re Rojas (1979) 23 Cal.3d 152 [151 Cal. Rptr. 649, 588 P.2d 789], where the Supreme Court held a defendant is entitled to no presentence credits when serving a sentence for a prior unrelated crime, reasoning, "Section 2900.5 does not authorize credit where the pending proceeding has no effect whatever upon a defendant's liberty." (Id. at p. 156.) Here, Lathrop was being held in lieu of bail simultaneously in two unrelated cases.
However, Lathrop's situation presents the "interesting circular issue" mentioned in People v. Huff (1990) 223 Cal. App.3d 1100 [273 Cal. Rptr. 44]. There, the defendant was simultaneously incarcerated for about one month on no-bail probation violation charges and on new charges with bail set at $15,000. (Id. at pp. 1102-1104.) The question was whether he was entitled to presentence credits for that period on the probation violation case. The court concluded the defendant satisfied "the strict causation test of Joyner," by virtue of his no-bail status. (Id. at p. 1106.)
*1405 In doing so, it recognized the issue that is presented if the defendant has bail set in both cases. (223 Cal. App.3d at p. 1106.) That is, in each case the prosecution could argue the defendant was not entitled to credit due to the inability to post bail in that case. The result could be the defendant could be denied credit in both cases.[3]
There is a solution to the problem. The first court to sentence should do so without regard to the other case, giving credit from the date the defendant was arrested on that case or a hold was placed due to it. Once that has been done, the defendant has been de facto sentenced to a term which commenced as of the arrest or hold date. When the second court imposes sentence, if it ever does, it will not give credit for time already credited to the first sentence, avoiding duplicative credit. Thus, the defendant will receive credit once, and only once, for presentence custody time. Neither Rojas, Joyner, nor their progeny will be violated.
The judgment of conviction is affirmed but the cause is remanded for modification of the sentence, consistent with this opinion.
Crosby, Acting P.J., and Wallin, J., concurred.
NOTES
[1]  The court also reasoned, "So, he's not being denied credits. It's just they're being deferred to the later court, which is exactly what [the Supreme Court in In re Joyner (1989) 48 Cal.3d 487 (256 Cal. Rptr. 785, 769 P.2d 967)] has instructed me to do."
[2]  The Supreme Court limited its holding to the facts of the case, not intending to create any wide-sweeping rule. (48 Cal.3d at p. 495.)
[3]  For example, suppose there were two cases, each with bail of $10,000, and the defendant had only $1,000 with which to obtain one $10,000 bond. Because posting bail on one case would not result in freedom on the other, the defendant would not waste the money. Alternatively, the defendant might be reticent to post bail on one case in favor of the other because that case might be the only one resulting in a sentence and the defendant would get no presentence credit on that case. No matter why the defendant failed to post bail, the prosecutor on each case would argue that case was the one on which the defendant could or should have posted bail. Unless the defendant could conclusively prove to the contrary, credit would be denied in both cases for failure to prove "strict causation."
