Any person convicted of a second offense committed within a period of five to 10 years of a prior offense under ยง 18.2-266 shall upon conviction of the second offense be punished by a mandatory minimum fine of $500 and by confinement in jail for not less than one month.