13-707. Misdemeanors; sentencing
A. A sentence of imprisonment for a misdemeanor shall be for a definite term to be served other than a place within custody of the state department of corrections. The court shall fix the term of imprisonment within the following maximum limitations:
1. For a class 1 misdemeanor, six months.
2. For a class 2 misdemeanor, four months.
3. For a class 3 misdemeanor, thirty days.
B. A person who is at least eighteen years of age or who has been tried as an adult and who stands convicted of any misdemeanor or petty offense, other than a traffic offense, and who has been convicted of one or more of the same misdemeanors or petty offenses within two years next preceding the date of the present offense shall be sentenced for the next higher class of offense than that for which the person currently is convicted. Time spent incarcerated within the two years next preceding the date of the offense for which a person is currently being sentenced shall not be included in the two years required to be free of convictions.
C. If a person is convicted of a misdemeanor offense and the offense requires enhanced punishment because it is a second or subsequent offense, the court shall determine the existence of the previous conviction. The court shall allow the allegation of a prior conviction to be made in the same manner as the allegation prescribed by section 28-1387, subsection A.
D. A person who has been convicted in any court outside the jurisdiction of this state of an offense that if committed in this state would be punishable as a misdemeanor or petty offense is subject to this section. A person who has been convicted as an adult of an offense punishable as a misdemeanor or petty offense under the provisions of any prior code in this state is subject to this section.
E. The court may direct that a person who is sentenced pursuant to subsection A of this section shall not be released on any basis until the sentence imposed by the court has been served.