(1) If a convicted person had been remanded in custody or otherwise been kept in detention because of an offence which is or was the object of the proceedings, any time spent in such custody or detention shall be credited towards a fixed term of imprisonment or a fine. The court may order for such time not to be credited in whole or in part if in light of the conduct of the convicted person after the offence this would be inappropriate.
(2) If in a later proceeding another sentence is substituted for a previously imposed sentence after that sentence had become final, time served under or credited towards the earlier sentence shall be credited against the new sentence.
(3) If a convicted person has already been sentenced abroad for the same offence, the foreign sentence, to the extent it has been served, shall be credited towards the new sentence. Subsection (1) above shall apply mutatis mutandis to any other detention suffered abroad.
(4) For the purpose of crediting a fine against time in detention, or vice versa, one day of detention shall correspond to one daily unit. If a foreign sentence or time in detention is to be credited, the court shall determine the rate as it sees fit.
(5) For the purpose of crediting a period of provisional disqualification from driving (section 111a of the Code of Criminal Procedure) against a driving ban under section 44, subsection (1) above shall apply mutatis mutandis. For this purpose, the provisional deprivation of a driving licence or its seizure (section 94 of the Code of Criminal Procedure) shall be equivalent to a provisional disqualification.