(1) Every person committed to the department under this chapter who has not been discharged as provided in this chapter shall be discharged at the expiration of one year or the expiration of the maximum term prescribed by the law for the offense for which he or she was committed subject to sub. (2) and the credit provisions of s. 973.155, whichever period of time is greater, unless the department has petitioned for civil commitment of the person under s. 51.20. For the purpose of this subsection, sentence shall begin at noon of the day of the commitment by the court to the department.(2) All commitments under s. 975.06 for offenses committed after July 1, 1970, shall be subject to ss. 302.11 and 302.12. If the department is of the opinion that release on parole under s. 53.11 (7) (a), 1981 stats., would be dangerous to the public, it shall petition for civil commitment under s. 51.20.(3) Every person subject to the extended control of the department under ss. 975.13 to 975.15, 1977 stats., shall be discharged 5 years from the date of the commencement of extended control unless previously discharged under s. 975.15. If the department is of the opinion that release of a person from extended control would be dangerous to the public, it shall petition for civil commitment under s. 51.20.1977 c. 353; 1979 c. 117; 1983 a. 528 s. 28; 1989 a. 31. Equal protection requires that a sex offender be credited with preconviction detention time in order to accelerate the date of expiration of the maximum term under s. 975.12. Milewski v. State, 74 Wis. 2d 681, 248 N.W.2d 70 (1976). A ch. 980 commitment is not an extension of a commitment under ch. 975, and s. 975.12 does not limit the state's ability to seek a separate commitment under ch. 980 of a person originally committed under ch. 975. State v. Post, 197 Wis. 2d 279, 541 N.W.2d 115 (1995), 94-2356.