Appellant, then seventeen years of age, pled guilty in November, 1984 to a charge of strong-armed robbery, § 812.13, Fla. Stat. (1983). He was adjudicated guilty and sentenced under the Youthful Offender Act, chapter 958, Florida Statutes (1983), to four years in a youthful offender facility, followed by two years of community control. In October, 1987, the trial court revoked appellant’s community control upon a finding that appellant had violated certain conditions,1 and sentenced him to a term of nine years imprisonment, with credit for time served.
This court has held in Dixon v. State, 546 So.2d 1194 (Fla. 3d DCA 1989) (Letts, Assoc. J., dissenting in part); Warren v. State, 542 So.2d 429 (Fla. 3d DCA 1989) Miles v. State, 536 So.2d 262 (Fla. 3d DCA 1988); and Hall v. State, 536 So.2d 268 (Fla. 3d DCA 1988) that it is error for the trial court upon revocation of probation or community control to sentence a defendant who, when the offense was committed, was a youthful offender, to a term in excess of the maximum penalty established by chapter 958. We have also held that the alternative provisions of section 958.14 (as amended in 1985) apply to sentences imposed for offenses committed, as was the instant offense, prior to the effective date of the amended statute. Dixon v. State, 546 So.2d at 1105-96.2 Also see Franklin v. State, 545 So.2d 851 (Fla.1989). Accordingly we agree with appellant’s contention that the maximum sentence which could be imposed upon revocation of appellant’s community control was six years. The sentence appealed from is reversed.
Appellant further contends that he has already served that portion of the sentence which the trial court properly imposed. However, we are unable to determine the accuracy of this contention from the record before us. We therefore remand the cause for the trial court to make a determination as to appellant’s proper *1140release date. Appellant is entitled to receive credit for all time served by him in incarceration prior to the revocation of his community control, as well as credit for gaintime, State v. Green, 547 So.2d 925 (Fla.1989); Dixon, 546 So.2d at 1198.
Reversed and remanded, with directions.
NESBITT and FERGUSON, JJ., concur.
. Appellant does not challenge by this appeal the trial court’s revocation of his community control.
. Section 958.14, Florida Statutes was amended in 1985 to add the underlined language:
A violation or alleged violation of probation or the terms of a community control program shall subject the youthful offender to the provisions of s. 948.06(1). However, no youthful offender shall be committed to the custody of the department for such violation for a period longer than 6 years or for a period longer than the maximum sentence for the offense for which he was found guilty, whichever is less, with credit for time served while incarcerated.