
355 N.W.2d 518 (1984)
STATE of Nebraska, Appellee,
v.
Kevin J. HUTTON, Appellant.
No. 83-881.
Supreme Court of Nebraska.
October 5, 1984.
*519 James P. Miller and Owen A. Giles, Papillion, for appellant.
Paul L. Douglas, Atty. Gen. and Mel Kammerlohr, Lincoln, for appellee.
KRIVOSHA, C.J., and BOSLAUGH, WHITE, HASTINGS, CAPORALE, SHANAHAN, and GRANT, JJ.
HASTINGS, Justice.
The defendant appeals a conviction and sentence of 1 year in the county jail for threatening another in a menacing manner in violation of Neb.Rev.Stat. § 28-310(1)(b) (Reissue 1979), a Class I misdemeanor.
The defendant was originally charged with the December 15, 1982, attempted first degree sexual assault of a 19-year-old female, which is a Class III felony. The defendant entered a plea of guilty to the misdemeanor, pursuant to a plea bargain whereby the attempted first degree sexual assault charge was dismissed, as was a charge of false imprisonment, and the county attorney was to make a sentencing recommendation to the probation officer.
On his appeal to this court the defendant assigns three errors. He claims that (1) the court erred in receiving a guilty plea *520 which was not made freely, voluntarily, and intelligently; (2) the court erred in proceeding to sentence the defendant when the State of Nebraska failed to honor its plea agreement; and (3) having sentenced the defendant to the maximum term of imprisonment provided by law, the court erred in failing to give defendant all previous time served pending disposition of this case. We affirm.
The defendant was represented by counsel during all stages of these proceedings. The court fully and accurately explained to the defendant his rights and to what he would be subjecting himself in the event that he pleaded guilty. The arraignment was a splendid example of how such a proceeding should be conducted. The only problem arose on the establishment of a factual basis for the plea.
The factual basis for the plea was supplied originally by the county attorney. In general, he related that the victim had been babysitting for the defendant and his wife; the victim was sitting on the couch when the defendant came home; the defendant pushed the victim onto the couch, fondled her, and would not move from the couch until she agreed not to tell anyone what had transpired. She attempted to call on the telephone, but the defendant would not allow her to do so; he stood "in a menacing manner" and would not allow her to leave the premises until she made the promise that she would not report the incident or the fondling to anyone.
The defendant admitted "some of it," but denied not letting her call, or holding her physically. However, he did state that "I suppose I did push her on the couch or something, you know, of that nature.... I think once she did want to call somebody or something and I didn't let her use it."
Following the foregoing exchange, the court was assured by defendant's counsel that the plea was consistent with the law and the facts, was in defendant's best interest, and was freely, voluntarily, and intelligently made. The court then again addressed the defendant and was told he was entering the plea without threats or promises, that he understood that once the court imposed sentence he could not withdraw the plea, and that he still wanted to offer the plea of guilty.
It is on the basis of the foregoing facts that the defendant now claims his plea was not entered freely, voluntarily, and intelligently. Such a claim is frivolous and utter nonsense. The defendant was not sentenced until some 4 months later, at which time, in response to a question from the court, the defendant agreed that he knew of no reason why sentence should not then be imposed.
A factual basis for a plea of guilty may be obtained from sources other than the defendant, including information furnished by the county attorney. State v. Sare, 209 Neb. 91, 306 N.W.2d 164 (1981). In the final analysis, it is only necessary that the record affirmatively disclose that a counseled defendant entered the guilty plea understandingly and voluntarily. State v. Tweedy, 209 Neb. 649, 309 N.W.2d 94 (1981). The record in this instance leaves no doubt that such was the case here.
Although the record indicates that the county attorney, as a part of the plea bargain, was to make a recommendation as to sentencing to the probation officer, the court specifically stated to the defendant that he should understand that regardless of whatever recommendation was made, the court was not bound by it.
Although the defendant makes the assumption that the recommendation would be favorable to him, that fact is not disclosed by the record. In any event, a defendant has no legal basis to rely on a sentence recommendation as a part of a plea bargain where the trial court has made it clear that it was not in any way bound by such agreement. State v. Tweedy, supra. Therefore, the failure to make such a recommendation, if such was the case here, would also furnish no basis for setting aside the conviction of the defendant.
Regarding the defendant's claim that he was entitled to credit as jail time the time *521 which he spent at the Hastings Regional Center for voluntary alcoholism treatment, there is nothing in the bill of exceptions concerning this matter. However, the transcript does reveal that an order was entered by the county court for Sarpy County authorizing transportation of the defendant by the sheriff to the regional center for such voluntary treatment, and directing the sheriff to return the defendant to jail upon completion of treatment. Endorsed on the order is the return of the sheriff indicating that he did in fact transport the defendant to that facility on January 6, 1983.
The record does not disclose when the defendant was returned to the custody of the sheriff. The presentence investigation report contains a "discharge summary" from the Hastings Regional Center stating that the defendant was admitted on January 6, 1983, and discharged January 28. The record "suggests" that defendant was admitted to bond on that date. In any event, the defendant only asks for credit from December 15, 1982, the date of his arrest, until January 28, 1983, the date of his discharge from the Hastings facility.
It is true, where the term of a sentence of imprisonment is the statutory maximum for the offense, credit must be given for jail time. State v. Holloway, 212 Neb. 426, 322 N.W.2d 818 (1982). The sentence imposed on the defendant in this case was the maximum term. He was given credit for but 1 day in jail. He should have been given credit for 22 days served from December 15, 1982, until January 6, 1983.
In State v. Prosser, 209 Neb. 766, 311 N.W.2d 525 (1981), a case not involving a maximum sentence, we held that the failure of a trial court to give credit on a sentence for presentence time spent in a mental institution was not an abuse of discretion.
We adopt the reasoning of the Iowa Supreme Court as expressed in State v. Wiese, 342 N.W.2d 858 (Iowa 1984), that crediting time spent in a voluntary alcohol treatment program following a conviction for driving while intoxicated, as compared to an involuntary commitment by the court authorized by statute, would be akin to allowing a defendant to choose his own place and length of confinement, and the denial of such credit was not an abuse of discretion. To hold otherwise would be to permit credit for time served in connection with wholly unrelated charges based on conduct other than that for which the defendant is ultimately sentenced, condemned in State v. Eugene, 340 N.W.2d 18 (N.D.1983).
The judgment and sentence of the district court should have provided credit for jail time totaling 22 days, and as so modified, they are affirmed.
AFFIRMED AS MODIFIED.
