Any court having jurisdiction for the trial of a person charged with a misdemeanor, traffic offense, any offense under Chapter 5 (§ 20-61 et seq.) of Title 20, or a felony that is not an act of violence as defined in § 19.2-297.1 may, for good cause, if the defendant is convicted and sentenced to confinement in jail and the active portion of the sentence remaining to be served is 45 days or less, impose the remaining time to be served on weekends or nonconsecutive days to permit the convicted defendant to retain gainful employment; however, the court shall not impose weekends or nonconsecutive days for a person convicted of a felony if the Commonwealth objects. A person sentenced pursuant to this section shall pay an amount to defray the cost of his keep, which amount shall be the actual cost of incarceration but shall not exceed that amount charged to the Compensation Board for purposes of reimbursement as provided in the general appropriation act. Such amount shall be collected by the sheriff, if he is responsible for operating a jail, or by the regional jail superintendent, and remitted by the sheriff to the treasurer of the appropriate county or city, or by the regional jail superintendent to the regional jail board or authority, solely for the purposes of defraying the costs of such weekend or nonconsecutive incarceration. The funds collected pursuant to this section shall not be used for purposes other than those provided for in this section. The assessment provided for herein shall be in addition to any other fees prescribed by law. If the defendant willfully fails to report at times specified by the court, the sentence imposed pursuant to this section shall be revoked and a straight jail sentence imposed.
If an offender who has been sentenced to nonconsecutive days by the court is in violation of the rules of the jail pursuant to § 53.1-117, the sheriff or jail administrator may require the offender to serve out a portion or the entirety of the remainder of his sentence in consecutive days. Upon revoking the offender's ability to serve his sentence on nonconsecutive days, the sheriff or jail administrator shall notify in writing the court that sentenced the offender and indicate the specific violations that led to the decision.
The time served by a person sentenced for violation of state law in a local jail, regional jail, or local jail farm pursuant to this section shall be included in the count of prisoner days reported by the Department for the purpose of apportioning state funds to local correctional facilities for operating costs in accordance with § 53.1-84.
Va. Code § 53.1-131.1