(a) This section does not apply to a parolee who is returned to the custody of the Division of Correction because of a subsequent crime and is confined before being sentenced for the subsequent crime.
(b) (1) A defendant who is convicted and sentenced shall receive credit against and a reduction of the term of a definite or life sentence, or the minimum and maximum terms of an indeterminate sentence, for all time spent in the custody of a correctional facility, hospital, facility for persons with mental disorders, or other unit because of:
(i) the charge for which the sentence is imposed; or
(ii) the conduct on which the charge is based.
(2) If a defendant is in custody because of a charge that results in a dismissal or acquittal, the time that would have been credited if a sentence had been imposed shall be credited against any sentence that is based on a charge for which a warrant or commitment was filed during that custody.
(3) In a case other than a case described in paragraph (2) of this subsection, the sentencing court may apply credit against a sentence for time spent in custody for another charge or crime.
(c) A defendant whose sentence is set aside because of a direct or collateral attack and who is reprosecuted or resentenced for the same crime or for another crime based on the same transaction shall receive credit against and a reduction of the term of a definite or life sentence, or the minimum and maximum terms of an indeterminate sentence, for all time spent in custody under the prior sentence, including credit applied against the prior sentence in accordance with subsection (b) of this section.
(d) A defendant who is serving multiple sentences, one of which is set aside as the result of a direct or collateral attack, shall receive credit against and a reduction of the remaining term of a definite or life sentence, or the remaining minimum and maximum terms of an indeterminate sentence, for all time spent in custody under the sentence set aside, including credit applied against the sentence set aside in accordance with subsection (b) of this section.
(e) (1) The court shall award the credit required by this section at the time of sentencing.
(2) After having communicated with the parties, the court shall tell the defendant and shall state on the record the amount of the credit and the facts on which the credit is based.
Structure Maryland Statutes
Title 6 - Trial and Sentencing
Part II - Sentencing Procedures
Section 6-216 - Judicial Sentencing Guidelines
Section 6-217 - Announcement of Minimum Confinement for Violent Crime
Section 6-218 - Credit Against Sentence for Time Spent in Custody
Section 6-219 - Suspension of Sentence and Other Conditions Placed on Sentence
Section 6-220 - Probation Before Judgment
Section 6-221 - Suspension of Sentence or Probation After Judgment
Section 6-222 - Limits on Probation After Judgment; Extension for Restitution
Section 6-223 - Additional Powers of District Court
Section 6-224 - Sentencing by Other Judge
Section 6-225 - Conditions of Probation After Judgment
Section 6-226 - Fees for Probation Under Supervision of Division of Parole and Probation
Section 6-229 - Nolle Prosequi or Stet With Requirement of Drug or Alcohol Treatment
Section 6-230 - Orders Striking Entry of Judgment; When Prohibited
Section 6-231 - Considerations and Findings Prior to Revocation of Probation
Section 6-232 - Notice to Defendant Regarding Expungement of Record
Section 6-233 - Domestically Related Crimes
Section 6-234 - Transfer of Firearm Upon Conviction of a Disqualifying Crime