[240ZA Time remanded in custody to count as time served: terms of imprisonment and detention]
[240ZA Time remanded in custody to count as time served: terms of imprisonment and detention]

[(1)     This section applies where—

(a)     an offender is serving a term of imprisonment in respect of an offence, and

(b)     the offender has been remanded in custody (within the meaning given by section 242) in connection with the offence or a related offence.

(2)     It is immaterial for that purpose whether, for all or part of the period during which the offender was remanded in custody, the offender was also remanded in custody in connection with other offences (but see subsection (5)).

(3)     The number of days for which the offender was remanded in custody in connection with the offence or a related offence is to count as time served by the offender as part of the sentence.

But this is subject to subsections (4) to (6).