Section 389(4) in The Code of Criminal Procedure, 1973
(4)When the appellant is ultimately sentenced to imprisonment for a term or to imprisonment for life, the time during which he is so released shall be excluded in computing the term for which he is so sentenced.