(a) Every person who violates Section 459, punishable as a second-degree burglary pursuant to subdivision (b) of Section 461, during and within an affected county in a "state of emergency" or a "local emergency," or under an "evacuation order," resulting from an earthquake, fire, flood, riot, or other natural or manmade disaster shall be guilty of the crime of looting, punishable by imprisonment in a county jail for one year or pursuant to subdivision (h) of Section 1170. Any person convicted under this subdivision who is eligible for probation and who is granted probation shall, as a condition thereof, be confined in a county jail for at least 180 days, except that the court may, in the case where the interest of justice would best be served, reduce or eliminate that mandatory jail sentence, if the court specifies on the record and enters into the minutes the circumstances indicating that the interest of justice would best be served by that disposition. In addition to whatever custody is ordered, the court, in its discretion, may require any person granted probation following conviction under this subdivision to serve up to 240 hours of community service in any program deemed appropriate by the court, including any program created to rebuild the community. For purposes of this subdivision, the fact that the structure entered has been damaged by the earthquake, fire, flood, or other natural or manmade disaster shall not, in and of itself, preclude conviction.