A person convicted of a felony in the district court and held in official confinement while awaiting the outcome of an appeal, writ of error to, or writ of certiorari from, a state or federal appellate court or prior to his release as a result of postconviction proceedings or habeas corpus, shall be given credit for the period spent in confinement against any sentence finally imposed for that offense. History: 1953 Comp., § 40A-29-24, enacted by Laws 1967, ch. 221, § 1; and recompiled as 1953 Comp., § 40A-29-47, by Laws 1977, ch. 216, § 16.