Time served in pre-trial detention is credited against the custodial sentence under section 38 StGB and shortens the remaining sentence to be enforced.
Under section 38 StGB pre-trial detention must be credited against a custodial sentence, provided it was suffered after the commission of the offence for which the person is sentenced, or otherwise on suspicion of a punishable act. The crediting is not discretionary: the court must carry it out in the judgment. In practice this means the sentence still to be enforced is shorter by the duration of the pre-trial detention. Where crediting is full, the sentence may be regarded as already served.
What to do now: First, check the judgment to confirm that the entire period of pre-trial detention is correctly recorded in the operative part. Second, if there are discrepancies engage the defence immediately, because errors in crediting can only be corrected on appeal. Third, ensure that the same period of detention is not credited in two separate proceedings.