
108 N.J. Super. 442 (1970)
261 A.2d 682
STATE OF NEW JERSEY, PLAINTIFF-RESPONDENT,
v.
JOSEPH MARNIN, DEFENDANT-APPELLANT.
Superior Court of New Jersey, Appellate Division.
Argued January 5, 1970.
Decided February 10, 1970.
*443 Before Judges SULLIVAN, CARTON and HALPERN.
Mr. Kenneth S. Javerbaum, Assistant Deputy Public Defender, argued the cause for appellant (Mr. Stanley C. Van Ness, Public Defender, attorney; Mrs. Miriam N. Span, Assistant Deputy Public Defender, on the brief).
Mr. Charles D. Sapienza, Assistant Prosecutor, argued the cause for respondent (Mr. James A. Tumulty, Jr., Prosecutor of Hudson County, attorney).
*444 The opinion of the court was delivered by CARTON, J.A.D.
In 1953 defendant was convicted on indictments charging assault with a dangerous weapon, assault with intent to rob, robbery, and robbery while armed. He was sentenced to consecutive terms totalling 22 to 29 years in prison (receiving 12 to 15 years on the robbery and robbery while armed charge).
In a 1965 post-conviction relief proceeding the trial court set aside the 12  15-year sentence as illegal because it "lumped together" counts charging robbery and robbery while armed, thereby rendering the propriety of the minimum and maximum sentences for each uncertain. In resentencing defendant the court imposed a 10  15-year sentence on the robbery charge and a 3  5-year sentence on the robbery while armed count, these sentences to run concurrently with those imposed on the other indictments. Since defendant had already served 2 years, 8 months and 15 days in excess of the imprisonment which the new concurrent sentencing had allocated, he was released from prison.
In 1968, in an unrelated case, defendant was found guilty on two charges of robbery while armed and was sentenced to a prison term of 8 to 11 years. In this post-conviction relief proceeding he seeks to credit the excess time he served in prison on the 1953 conviction against the sentence he is presently serving on his 1968 conviction. We agree with the trial court's conclusion that he is not entitled to such credit.
Where an illegal sentence has been set aside and a valid one later imposed for the same offense, fair dealing as well as due process seem to dictate that credit be given for time already spent in prison. See 5 Wharton, Criminal Procedure § 2216 (Supp. 1969). But time spent in custody is required to be credited only against the sentence on the charge which brought about that custody. Cf. State ex rel. Kincaid v. State Parole Bd., 53 N.J. Super. 526 (App. Div. 1959); Lipschitz v. State, 43 N.J. Super. 522 (App. Div. *445 1957); State v. Van Dorn, 43 N.J. Super. 406 (App. Div. 1957); Bauers v. Yeager, 261 F. Supp. 420 (D.N.J. 1966).
However, due process does not mandate that time spent in custody must be credited against a sentence resulting from another conviction for an unrelated offense. Bauers v. Yeager, supra; United States ex rel. Smith v. Rundle, 285 F. Supp. 965 (E.D. Penn. 1968); State v. Barbato, 89 N.J. Super. 400 (Cty. Ct. 1965).
The court in Bauers v. Yeager pointed out the incongruous result which might accrue if such a contention were accepted:
* * * If [due process required such crediting] * * * that would mean that the situation could be created wherein a person might have several years of prison time to apply to a sentence for a crime that he has not yet committed or, for which he has not yet been prosecuted. [261 F. Supp., at 424]
Nor do we believe it would be in the interest of the administration of justice to accept as a principle that time already served must be applied to any subsequent sentence. Even though that custody may have been the product of an invalid sentence, unlike money on deposit in the bank or a credit card, it may not be drawn on or credited against penalties imposed for later criminal activities. The granting of such a credit is at best discretionary, based upon the general equities of the situation, and is not a matter of due process. These requirements are certainly satisfied when an individual in defendant's postion is afforded an opportunity to inform the court, on the sentencing for the later conviction, of his prior illegal incarceration so that it might be taken into consideration. See Bauers v. Yeager, supra; United States ex rel. Jackson v. Myers, 374 F.2d 707 (3 Cir.1967). This was done in the present case.
Affirmed.
