The conditions of probation imposed pursuant to § 23A-27-12 or 23A-27-13 or the conditions of suspension of execution imposed pursuant to § 23A-27-18, may include the requirement that the defendant be imprisoned in the county jail for no more than one hundred eighty days, except as otherwise specified in this section, or in a state correctional facility for no more than one hundred eighty days or the sentence which was imposed or which may be imposed by law, whichever is less. However, for persons sentenced pursuant to § 32-23-4.6, the conditions of probation imposed pursuant to § 23A-27-12 or 23A-27-13 or the conditions of suspension of execution imposed pursuant to § 23A-27-18, may include the requirement that the defendant be imprisoned in the county jail for a specific period not exceeding three hundred sixty-five days. The imprisonment may be further restricted to certain days specified by the court as part of such conditions. The required period of imprisonment for a county jail or state incarceration term should not exceed sixty consecutive days to ensure the court retains authority to impose additional days of imprisonment, if necessary, during the term of supervision pursuant to § 16-22-13. The court retains jurisdiction to raise or lower the required period of imprisonment within the sentence otherwise allowed by law. Any such imprisonment, either in the county jail or state correctional facility, shall be credited toward any incarceration imposed upon any subsequent revocation of a suspended imposition or execution of sentence. During any such imprisonment the defendant shall be subject to all policies, rules, and regulations of the county jail or state correctional facility.
SDCL 23A-27-18.1