Appellant urges he is entitled to credit for the time he spent in the state hospital under commitment as a mentally disordered sex offender. Section 917.218, Florida Statutes (1977). We agree that appellant is entitled to such credit. Hall v. State, 358 So.2d 891 (Fla. 2d DCA 1978). Accordingly, the judgment is affirmed, but the cause is remanded with directions to give appellant credit for the time he spent in the mentally disordered sex offender program.
McCORD, C. J., and BOOTH and LARRY G. SMITH^ JJ., concur.