This is an appeal from the partial denial of a motion to correct appellant’s sentence filed pursuant to Rule 3.850, Florida Rules of Criminal Procedure. We hold that appellant was entitled to credit for the entire period he was committed to the Division of Mental Health for treatment prior to sentencing; we therefore reverse.
Appellant was originally charged with and pled guilty to several charges of involuntary sexual battery. He was found to be a child molester within the purview of Chapter 801, Florida Statutes (1975) and was committed to the Department of Offender Rehabilitation and the Division of Mental Health for treatment on May 26, 1976.
*202On January 20, 1978 appellant was returned to the trial court and given concurrent sentences of 19 years on each charge; he was not given credit for the time he spent in the State Hospital at Chattahoochee. He subsequently filed the instant motion seeking such credit.
At the hearing on the motion, defense counsel noted that Chapter 801 (the Child Molester Act) had been repealed effective July 1, 1977 by Chapter 77-312, Laws of Florida, which, in effect, transferred the provisions of Chapter 801 to Chapter 917 (the Mentally Disordered Sex Offender Act). Thus, Chapter 917 replaced the provisions of Chapter 801 and became applicable to those in appellant’s position. Chapter 77-312 also added Section 917.218 requiring that credit be given for time served in the mentally disordered sex offender program. The state took the position that because appellant was not placed in the mentally disordered sex offender program initially, he was only entitled to credit from July 1, 1977. The trial court agreed with the state and granted appellant credit only from July 1, 1977.
Appellant is entitled to credit for time served in the mentally disordered sex offender program. Hall v. State, 358 So.2d 891 (Fla. 2d DCA 1978). It is obvious from the legislative history of Chapter 917 that the legislature intended Section 917.218 to apply to those originally committed under the Child Molester Act as well as other mentally disordered sex offenders. It is evident that in repealing Chapter 801 the legislature intended all of the provisions of the revised Chapter 917 to be applicable in place of Chapter 801. Appellant is therefore entitled to credit from the date of his commitment.
Accordingly, the trial court’s order is reversed insofar as it denies appellant credit for the time he spent in the State Hospital under commitment pursuant to Chapter 801 prior to July 1, 1977. The cause is remanded for entry of an order awarding appellant appropriate credit consistent with this opinion.
GRIMES, C. J., and HOBSON, J., concur.