Every person convicted of a felony on or after October 1, 1942 and every person convicted of a misdemeanor and confined in any state correctional facility shall, for every twenty days of confinement after sentence, either in a local correctional facility awaiting transfer to the Department or in any state correctional facility serving the sentence imposed upon him, without violation of any written jail or prison rule or regulation, be allowed a credit of ten days upon his total term of confinement to which he has been sentenced, in addition to the time he actually serves. So much of the credit allowed to misdemeanants by this section as applies to time served prior to June 24, 1944, shall be in lieu of, and not in addition to, any credit they may have earned under the law as it existed prior to such date.
Any credit allowed under the provisions of this section shall also be considered as reducing the term of imprisonment to which the prisoner was or is sentenced for the purpose of determining his eligibility for parole.
So much of an order of any court contrary to the provisions of this section shall be deemed null and void.
Va. Code § 53.1-196