Whenever a person receives evaluation, training or treatment services under this part or part 5 of this chapter in connection with a criminal charge or conviction, wherever incarcerated, the person shall receive credit toward the satisfaction of the sentence for the time spent in the custody of the commissioner.