When sentence is pronounced, the trial court must give the defendant credit on that sentence for:
-
(a) all time the defendant has been confined since the time when judgment and sentence should have been entered and pronounced; and
-
(b) all time between the defendant's arrest and confinement to the time when judgment and sentence should have been entered and pronounced.