609.145 Credit for prior imprisonment.
Subdivision 1. Prior imprisonment reduction. When a person has been imprisoned pursuant to a conviction which is set aside and is thereafter convicted of a crime growing out of the same act or omission, the period of imprisonment to which the person is sentenced is reduced by the period of the prior imprisonment and the time earned thereby in diminution of sentence.
Subd. 2. Reduction for time served before commitment to commissioner. A sentence of imprisonment upon conviction of a felony is reduced by the period of confinement of the defendant following the conviction and before the defendant's commitment to the commissioner of corrections for execution of sentence unless the court otherwise directs.
Subd. 3. Credit. When a person is to be committed to the commissioner, the person's probation officer must provide to the court, prior to the sentencing hearing, the amount of time the person has in credit for prior imprisonment. The court must pronounce credit for prior imprisonment at the time of sentencing.