Whenever a soldier is committed to jail, whether for trial or under sentence, his military rank shall always be stated in the warrant of commitment, in order that due notice may be given to the military authorities of the day on which, and hour at which, the imprisonment of such person will expire. ...