
108 Cal.App.3d 739 (1980)
166 Cal. Rptr. 549
THE PEOPLE, Plaintiff and Respondent,
v.
TRINIDAD ZUNIGA, Defendant and Appellant.
Docket No. 36280.
Court of Appeals of California, Second District, Division Two.
July 14, 1980.
*740 COUNSEL
Quin Denvir, State Public Defender, under appointment by the Court of Appeal, and Richard Lennon, Deputy State Public Defender, for Defendant and Appellant.
*741 George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, S. Clark Moore, Assistant Attorney General, Shunji Asari and Sharlene A. Honnaka, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
COMPTON, J.
Defendant appeals from a judgment sentencing him to serve three years in prison for the crime of burglary. His contentions on appeal address only the issue of credits allegedly due him pursuant to Penal Code sections 2900.5[1] and 4019.[2] We affirm.
*742 Defendant pleaded guilty to burglary and an allegation of a prior conviction was found to be true. A sentence of three years was suspended and defendant was placed on probation for three years on condition that he serve one year in the county jail.
At the time of sentencing defendant had been in custody 168 days. The trial court gave defendant the option of being sentenced to state prison or accepting probation with the condition of serving 1 year in the county jail without credit for the 168 days of presentence confinement. Defendant waived the provisions of Penal Code section 2900.5 and accepted the probationary order. Such waiver was proper (People v. Johnson (1978) 82 Cal. App.3d 183 [147 Cal. Rptr. 55]; In re Chamberlain (1978) 78 Cal. App.3d 712 [144 Cal. Rptr. 326]) and defendant does not contend otherwise.
The issues raised on this appeal emanate from the fact that, after defendant had served 156 days of the 1 year probationary sentence, he escaped from the county jail. After defendant was recaptured he pleaded guilty to the charge of escape. (Pen. Code, § 4532, subd. (b).) *743 Probation in the instant case was revoked and the prison sentence originally suspended was ordered to be served. Defendant was given credit on that sentence for the 156 days served and 26 days of work time, or a total of 182 days.
(1) Defendant now contends that he should also be credited with the time served prior to the original sentence as well as behavior credits provided for in Penal Code section 4019. We disagree. Defendant, in effect, bargained for a probationary sentence by initially waiving the provisions of Penal Code section 2900.5. The court complied and granted defendant the leniency of probation. Defendant now seeks to retract his portion of the bargain on the basis that he now has been removed from probation and sentenced to state prison. His argument appeals to neither logic nor justice.
Probation is a form of leniency which is predicated on the notion that a defendant, by proving his ability to comply with the requirements of the law and certain special conditions imposed upon him, may avoid the more severe sanctions justified by his criminal behavior. Once given the opportunity for lenient treatment the choice is his as to whether he merits being continued on probation.
Here defendant not only refused to comply with his conditions of probation but committed an additional crime in making his choice. He cannot use his own misconduct as a basis for setting aside the waiver which he executed as a condition for obtaining leniency in the first instance  in effect a renegotiation of his sentence on his own terms. (In re Chamberlain, supra, 78 Cal. App.3d 712.)
(2) Defendant was not entitled to so-called "good time" credits. The statute which provides for such credits (Pen. Code, § 4019) specifies that such credits are to be allowed if a person has complied with the rules and regulations of the facility in which he is confined. It is hard to envision a more graphic indication of lack of "good behavior" than an escape from the facility.
We do not read the statute as vesting a day of good time at the end of serving a six-day period. The underlying theory of crediting a prisoner for good behavior is to provide an incentive for such behavior. (People v. Saffell (1979) 25 Cal.3d 223 [157 Cal. Rptr. 897, 599 P.2d 92].) The ability to withhold such credit because of misbehavior at any *744 time during the sentence is essential to effectuate the purpose of the statute. (People v. Smith (1979) 98 Cal. App.3d 793 [159 Cal. Rptr. 749].)
The judgment is affirmed.
Roth, P.J., and Fleming, J., concurred.
Appellant's petition for a hearing by the Supreme Court was denied September 11, 1980.
NOTES
[1]  Penal Code section 2900.5 provides: "(a) In all felony and misdemeanor convictions, either by plea or by verdict, when the defendant has been in custody, including but not limited to any time spent in a jail, camp, work furlough facility, halfway house, rehabilitation facility, hospital, prison, juvenile detention facility, or similar residential institution, 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, or credited to any fine which may be imposed, at the rate of not less than thirty dollars ($30) per day, or more, in the discretion of the court imposing the sentence. If the total number of days in custody exceeds the number of days of the term of imprisonment to be imposed, the entire term of imprisonment shall be deemed to have been served. In any case where the court has imposed both a prison or jail term of imprisonment and a fine, any days to be credited to the defendant shall first be applied to the term of imprisonment imposed, and thereafter such remaining days, if any, shall be applied to the fine.

"(b) 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.
"(c) For the purposes of this section, "term of imprisonment" includes any period of imprisonment imposed as a condition of probation or otherwise ordered by a court in imposing or suspending the imposition of any sentence, and also includes any term of imprisonment, including any period of imprisonment prior to release on parole and any period of imprisonment and parole, prior to discharge, whether established or fixed by statute, by any court, or by any duly authorized administrative agency.
"(d) It shall be the duty of the court imposing the sentence to determine the date of admission to custody, the date of release from custody, and the total number of days to be credited pursuant to the provisions of this section. The total number of days to be credited shall be contained in the abstract of judgment provided for in Section 1213."
[2]  Penal Code section 4019 provides: "(a) The provisions of this section shall apply in all of the following cases: (1) When a prisoner is confined in or committed to a county jail, industrial farm, or road camp, or any city jail, industrial farm, or road camp, including all days of custody from the date of arrest to the date on which the serving of the sentence commences, under a judgment of imprisonment, or a fine and imprisonment until the fine is paid in a criminal action or proceeding.

"(2) When a prisoner is confined in or committed to the county jail, industrial farm, or road camp or any city jail, industrial farm, or road camp as a condition of probation after suspension of imposition of a sentence or suspension of execution of sentence, in a criminal action or proceeding.
"(3) When a prisoner is confined in or committed to the county jail, industrial farm, or road camp or any city jail, industrial farm, or road camp for a definite period of time for contempt pursuant to a proceeding, other than a criminal action or proceeding.
"(b) Subject to the provisions of subdivision (d), for each six-day period in which a prisoner is committed to a facility as specified in this section, one day shall be deducted from his period of confinement unless it appears by the record that the prisoner has refused to satisfactorily perform labor as assigned by the sheriff, chief of police, or superintendent of an industrial farm or road camp.
"(c) For each six-day period in which a prisoner is committed to a facility as specified in this section, one day shall be deducted from his period of confinement unless it appears by the record that the prisoner has not satisfactorily complied with the reasonable rules and regulations established by the sheriff, chief of police, or superintendent of an industrial farm or road camp.
"(d) Nothing in this section shall be construed to require the sheriff, chief of police, or superintendent of an industrial farm or road camp to assign labor to a prisoner if it appears from the record that the prisoner has refused to satisfactorily perform labor as assigned or that the prisoner has not satisfactorily complied with the reasonable rules and regulations of the sheriff, chief of police, or superintendent of any industrial farm or road camp.
"(e) No deduction may be made under this section unless the person is committed for a period of six days or longer."
