Each prisoner who has been sentenced to the county workhouse for any period of time less than one year on either a misdemeanor or a felony, and who behaves uprightly, shall have deducted from the sentence imposed by the court time equal to one quarter of such sentence. In calculating the amount of good time credit earned, the one-quarter reduction shall apply to the entire sentence, including pretrial and post-trial confinement. Fractions of a day's credit for good time of one-half or more shall be considered a full day's credit. If any prisoner violates the rules and regulations of the workhouse or otherwise behaves improperly, the sheriff or superintendent of the workhouse may revoke all or any portion of such prisoner's good time credit provided that the prisoner is given a hearing in accordance with due process before a disciplinary review board and is found to have violated the rules and regulations of the institution. T.C.A. § 41-2-111(b).