
156 Cal.App.3d 1131 (1984)
203 Cal. Rptr. 141
THE PEOPLE, Plaintiff and Respondent,
v.
GEORGE ERIC BROWN, Defendant and Appellant.
Docket Nos. F002548, F002549.
Court of Appeals of California, Fifth District.
June 7, 1984.
*1132 COUNSEL
Frank Di Sabatino, under appointment by the Court of Appeal, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, James T. McNally and James Ching, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[1]]
OPINION
THE COURT.[*]
In Stanislaus County Superior Court action No. 178632 appellant was convicted in 1981 of attempted violations of Penal Code sections *1133 484, and 487, subdivision 1. In October 1981 he was admitted to three years felony probation on each count, the conditions of which included one year local incarceration. In June 1982 appellant was released from county jail, having served 242 days actual time and received 120 days conduct credits. In Stanislaus County Superior Court action No. 186523 appellant was convicted in April 1983 of burglary. On May 9, 1983, appellant admitted that his conviction of a new criminal offense (the burglary) was a violation of his probation in action No. 178632. The trial court sentenced him to prison for the three-year upper base term on the burglary and four months on each attempt, the latter terms to run consecutive to the term for the burglary but concurrently with each other.
The trial court awarded appellant a total of 294 days presentence actual time and conduct credits on the burglary matter. The trial court also noted that appellant's total presentence credits of 362 days on the attempts exceeded the consecutive terms which had been imposed and that "the total amount of time that he'll be sentenced to the state prison would be three years with good time and work time credits of approximately 294 days." On May 10, 1983, the trial court denied a defense request to apply the excess credits from the attempt matters against appellant's three-year burglary sentence.
Appellant now contends the trial court abused its discretion in imposing the three-year upper base term on the burglary and in denying the defense motion for further credits against that term. Respondent disagrees.

I: UPPER BASE TERM[**]
.... .... .... .... .... .... .

II: CREDITS
Penal Code section 2900.5, subdivision (a) provides, in pertinent part: "In all felony and misdemeanor convictions, either by plea or by verdict, when the defendant has been in custody, ... all days of custody of the defendant, including days served as a condition of probation in compliance with a court order, and including days credited to the period of confinement pursuant to Section 4019, shall be credited upon his term of imprisonment.... If the total number of days in custody exceeds the number of days of *1134 the term of imprisonment to be imposed, the entire term of imprisonment shall be deemed to have been served...."
In People v. Riolo (1983) 33 Cal.3d 223 [188 Cal. Rptr. 371, 655 P.2d 723], the Supreme Court explained: "Section 2900.5, subdivision (a) mandates that all days of custody served for an offense be deducted from the `term of imprisonment' imposed for the offense. Subdivision (a) of section 1170.1 defines the `term of imprisonment' for a consecutive offense as one-third the middle base term for the offense. Read together, the statutes clearly specify that credits be deducted from the term of imprisonment prescribed by section 1170.1, one-third the middle base term." (At p. 226.)
In sentencing appellant on the attempts, the trial court complied with Riolo, deducting the applicable credits against the 2 four-month consecutive terms. (1a) However, since only 120 of the 362 days were needed to neutralize the consecutive terms, appellant argues the trial court was required to apply the remaining 242 days to further reduce the burglary sentence.
Penal Code section 2900.5, subdivision (b) provides: "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. Credit shall be given only once for a single period of custody attributable to multiple offenses for which a consecutive sentence is imposed."
Appellant argues his custody on the attempts was attributable to proceedings related to the burglary because "he would not have had his probation revoked and sentence imposed unless he had been convicted of the burglary and his sentence on the burglary would not have been aggravated but for his probationary status."
In In re Atiles (1983) 33 Cal.3d 805, 810 [191 Cal. Rptr. 452, 662 P.2d 910], the Supreme Court held: "In determining whether custody for which credit is sought under section 2900.5 is `attributable to proceedings leading to the conviction,' the sentencing court is not required to eliminate all other possible bases for the defendant's presentence incarceration. The court need only determine that the defendant was not already serving a term for an unrelated offense when restraints related to the new charge were imposed on him, and the conduct related to the new charge is a basis for those restraints.[5]"
*1135 During the period for which appellant seeks credit, from October 1981 to June 1982, appellant was in custody as a condition of probation on the attempts. He was not in custody on the burglary. Indeed, he had not yet committed it. It follows the burglary had no causal effect on appellant's custody between October 1981 and June 1982. That the burglary later became the basis for the May 1983 revocation of appellant's probation in the attempt matters did not retroactively transform the burglary into the cause of his earlier confinement on the attempts.
That appellant's probationary status on the attempts was one aggravating factor relied on to support the upper base term on the burglary likewise did not render the earlier confinement somehow attributable to proceedings related to the burglary.
The statutory question is whether the attempt proceedings prior to the May 1983 revocation of probation were related to the instant burglary within the meaning of section 2900.5. They were not. The instant burglary occurred on July 29, 1982. The attempt charges involved crimes committed August 12, 1981, almost one year earlier against victims entirely different.[2] Aside from and until the May 1983 revocation proceedings, the proceedings and crimes were, in every sense of the word, unrelated.
(2) Underlying appellant's contention is the premise that relying on facts pertaining to one or more crimes or criminal proceedings to aggravate another crime is tantamount to punishment for the former crime(s). This premise is simply incorrect. As we recently explained in People v. Young (1983) 146 Cal. App.3d 729 [194 Cal. Rptr. 338]: "If consideration of the facts of a particular crime is, as defendant implies, tantamount to punishment for that count, then a court could never consider the facts of dismissed or uncharged counts, since this would punish the defendant for crimes for which he was not convicted. In approving of the use of transactionally related criminal acts, our Supreme Court presupposed that such use is not punishment on the dismissed transactionally related crimes, but merely a consideration of the circumstances surrounding the crime of which the defendant was convicted." (At pp. 736-737.)
Moreover, if appellant's premise were correct a trial court could never rely on a defendant's prior convictions or prison terms to aggravate or enhance without violating double jeopardy and, in some cases, ex post facto prohibitions. Yet the trial court's consideration of such matters has been *1136 upheld against double jeopardy and ex post facto attack. (See In re McVickers (1946) 29 Cal.2d 264, 271 [176 P.2d 40]; People v. Williams (1983) 140 Cal. App.3d 445, 448-449 [189 Cal. Rptr. 497].) In sum, appellant's term was not aggravated for the prior attempts but for the instant burglary.
(1b) The simple fact is that appellant's custody between October 1981 and June 1982 was not attributable to proceedings relating to the burglary. Further, his prison sentence on the burglary was not the functional equivalent of a sentence on the attempts. (Cf. People v. Washington (1978) 80 Cal. App.3d 568, 571-573 [145 Cal. Rptr. 654].)
The judgments are affirmed.
NOTES
[1]  Part I of this opinion is not published, because it does not meet the standards for publication contained in California Rules of Court, rule 976(b).
[*]   Before Franson, Acting P.J., Andreen, J., and Martin, J.
[**]   See footnote 1, ante, page 1131.
[5]  "Restraints which make it impossible for a defendant to obtain his freedom pending trial include a parole hold (see In re Law (1973) 10 Cal.3d 21 [109 Cal. Rptr. 573, 513 P.2d 621]) and bail fixed in an amount that the defendant, whether indigent or not, cannot or does not post." (Ibid.)
[2]  The two attempt convictions were alternative counts based on one transaction in which appellant tried to use a stolen credit card to buy tires at a service station. That the two counts involved only one crime and that Penal Code section 654 would apply was recognized when appellant pled guilty in 1981. He raises no section 654 contention on this appeal.
