
382 So.2d 382 (1980)
Miguel ABRAHAM, Appellant,
v.
The STATE of Florida, Appellee.
No. 79-953.
District Court of Appeal of Florida, Third District.
April 1, 1980.
Rehearing Denied May 5, 1980.
Bennett H. Brummer, Public Defender and Robert R. Schrank, Asst. Public Defender, for appellant.
Jim Smith, Atty. Gen. and Anthony C. Musto, Asst. Atty. Gen., for appellee.
Before HUBBART and NESBITT, JJ., and CHARLES A. CARROLL (Ret.), Associate Judge.
PER CURIAM.
This appeal is by the defendant below from sentences imposed upon him by the circuit court of Dade County in two cases. The error complained of is failure of the court, in sentencing, to give the appellant-defendant credit for approximately four months time he had spent in the custody of the State, on order of the court in each such case, in the South Florida State Hospital's mentally disordered sex offender program.
The cases involved were circuit court Nos. 77-28262 and 78-12900. In the former, upon the defendant pleading guilty to a sex offense, adjudication of guilt was withheld and the defendant, on September 27, 1977, was placed on probation for a period of five years.
By an information filed September 12, 1978, the defendant was charged with burglary of a dwelling, in Case No. 78-12900. Thereafter, and based thereon, an application of violation of probation was filed against the defendant in Case No. 77-28262. The defendant admitted the violation of probation and pled guilty to the charge in Case No. 78-12900. The court entered an order in Case No. 77-28262 revoking probation, and in Case No. 78-12900 withheld adjudication, and in both cases ordered that the defendant be committed to the custody of the Department of Health and Rehabilitative Services as a mentally disordered sex offender, pursuant to Chapter 917, Florida Statutes (1977). The defendant so remained in the custody of the State from September 17, 1978, until a date in March of 1979 on which the defendant was returned to the court. On April 17, 1979, the court adjudged the defendant guilty in both cases and imposed sentences. The sentences, to run concurrently, were for imprisonment for a term of five years, with credit "for any time he's served in jail, but not in the hospital, against his sentence."
*383 By Section 917.218, Florida Statutes (1979) [Chapter 77-312, § 24, Laws of Florida, 1977, effective July 1, 1977], the defendant upon being so sentenced was entitled to credit for the time he thus had spent in the formal custody of the State.
On this appeal the State does not contend otherwise, but takes the position that when the defendant in the trial court did not object to or challenge the sentences for failure to allow such time credit, the error involved is not one to be reached on appeal, and that the defendant should be relegated to seeking appropriate relief in that regard by motion in the trial court under Fla.R. Crim.P. 3.850, citing Engel v. State, 353 So.2d 593 (Fla.3d DCA 1977), and Jenrette v. State, 373 So.2d 718 (Fla.3d DCA 1979), in which, as to questions that were raised on appeals relating to the propriety or legality of sentences, the sentences were affirmed without prejudice to the appellants-defendants to seek post-conviction relief from the sentences in those regards under the above cited rule.
In opposing that contention of the State the appellant cites Noble v. State, 353 So.2d 819 (Fla. 1978), as support for the argument that notwithstanding failure of the defendant to have challenged the sentences when made, for failure of the court to give credit for time for which the defendant claims entitlement, such challenge to the sentences when presented on appeal should be considered and decided by the appellate court.
We recognize that in most such instances it would be more expeditious and represent considerable saving in time, effort and expense for questions of that kind relating to sentences to be presented to trial courts by motion for post-conviction relief under Fla. R.Crim.P. 3.850, than to seek such relief by appeals, especially where a sentence may be improper or illegal in some respect that is patent under the law. However, on authority of Noble v. State, supra, we have here considered the question presented on this appeal, and hold that in the sentences that were imposed the defendant was entitled to credit for the period spent by him in State custody as above described, and that failure of the trial court to grant such credit in the sentences was error.
The cause is remanded to the circuit court with direction to revise the sentences to give the defendant credit in this connection, for the period of time which the court shall find to be applicable.
It is so ordered.
