
904 A.2d 443 (2006)
393 Md. 680
Tony Eugene BLICKENSTAFF
v.
STATE of Maryland.
No. 119, September Term, 2005.
Court of Appeals of Maryland.
August 1, 2006.
*444 George E. Burns, Jr., Assistant Public Defender (Nancy S. Forster, Public Defender, on brief), Baltimore, MD for Appellant.
Michelle W. Cole, Assistant Attorney General (J. Joseph Curran, Jr., Attorney General of Maryland, on brief), Baltimore, MD, for Appellee.
Argued before BELL, C.J., and RAKER, WILNER, CATHELL, HARRELL, BATTAGLIA and GREENE, JJ.
CATHELL, J.
This case arises from the denial by the Circuit Court for Frederick County of a motion to correct an alleged illegal sentence. On April 27, 2004, Tony Eugene Blickenstaff, appellant, entered a guilty plea to the crime of first degree escape.[1]*445 Pursuant to a plea agreement, he was sentenced to eighteen months in the local detention center, to run consecutive to the one-year sentence he was serving at the time of the escape. On May 20, 2005, appellant filed a Motion for Modification to Correct Illegal Sentence. On May 25, 2005, the motion was denied by the Circuit Court for Frederick County.
Appellant timely noted an appeal to the Court of Special Appeals. This Court, on its own initiative and prior to any proceedings in the intermediate appellate court, granted certiorari. Blickenstaff v. State, 390 Md. 500, 889 A.2d 418 (2006). Appellant submits one question:
"Did the trial court illegally sentence appellant to serve more than eighteen months in a local correctional facility?"
We hold that the plain language of the pertinent statute in the case sub judice does not prohibit a trial judge from sentencing an individual to serve more than a total of eighteen months in a local correctional facility based upon the aggregation of a prior sentence on an unrelated offense with the "then executed" sentence. Therefore, the trial court did not illegally sentence appellant.[2]

I. Facts
On July 9, 2004, appellant received a one-year sentence to be served in the Frederick County Adult Detention Center ("FCADC").[3] The court's commitment order authorized work release. On November 2, 2004, appellant failed to return to the FCADC from his work release assignment. A warrant was issued by the Circuit Court for Frederick County and on November 22, 2004, appellant was arrested in Florida and subsequently returned to the FCADC. On April 27, 2005, appellant pled guilty to first degree escape based on his failure to return to the FCADC pursuant to the terms of his work release. Appellant was offered a plea agreement providing for either a sentence of eighteen months in a local correctional facility or three years in the Division of Corrections. Appellant requested that he be sentenced to eighteen months in FCADC to run consecutive to his original one-year sentence. The trial judge then imposed that sentence.

II. Standard of Review
The case sub judice was tried without a jury. Pursuant to Maryland Rule 8-131(c), this Court will review the case on both the law and the evidence. We will not set aside the trial court's judgment based upon the evidence unless we find it to be clearly erroneous. Id. We recently stated in Gray v. State, 388 Md. 366, 879 A.2d 1064 (2005):
"The clearly erroneous standard does not apply to legal conclusions. Nesbit v. GEICO, 382 Md. 65, 72, 854 A.2d 879, 883 (2004). `When the trial court's order involves an interpretation and application of Maryland statutory and case law, our Court must determine whether the lower court's conclusions are legally correct under a de novo standard of review.' Nesbit, 382 Md. at 72, 854 A.2d at 883 (quoting Walter v. Gunter, 367 Md. 386, 392, 788 A.2d 609, 612 (2002))."
Gray, 388 Md. at 374-75, 879 A.2d at 1068. We shall address the legal issue of the sentencing in the case at bar under a de novo standard of review.


*446 III. Discussion
Maryland Code (1999), § 9-105 of the Correctional Services Article as relevant here provides:
"§ 9-105. Sentencing to local correctional facilities.
Notwithstanding any other law, a judge may sentence an individual to a local correctional facility if:
(1) the sentence to be then executed is for a period of not more than 18 months. . . ." (Emphasis added.)
Appellant argues that the trial judge illegally sentenced him to serve more than eighteen months in a local correctional facility  a violation of § 9-105  by making the eighteen-month sentence run consecutive to his original one-year sentence, thereby causing appellant's total incarceration time to exceed eighteen months.[4] The State argues that § 9-105 does not require a trial judge to consider previously imposed sentences for unrelated convictions. The State contends that "the sentence to be then executed" refers to the sentencing for the criminal conviction or convictions before the trial judge at a particular time, rather than previously imposed sentences for unrelated convictions. § 9-105 (emphasis added). We agree with the State.
It is first necessary to examine the language of § 9-105. As we recently stated in Toth v. State, 393 Md. 318, 901 A.2d 820 (2006):
"The cardinal rule of statutory interpretation is to ascertain and effectuate the intention of the Legislature. Mackey v. Compass Mktg., Inc., 391 Md. 117, 141, 892 A.2d 479, 493 (2006); Kushell v. DNR, 385 Md. 563, 576, 870 A.2d 186, 193 (2005). If the statute is unambiguous when construed according to its ordinary and everyday meaning, then we give effect to the statute as it is written. Mackey, 391 Md. at 141, 892 A.2d at 493; Collins v. State, 383 Md. 684, 689, 861 A.2d 727, 730 (2004)."
Toth, 393 Md. at 324-25, 901 A.2d at 824 (2006). The plain language of § 9-105 is clear and unambiguous. A trial judge may sentence a defendant to a local correctional facility if the sentence "to be then executed is for a period of not more than 18 months." § 9-105 (emphasis added). The word "then" contemplates sentencing at that particular disposition, not the aggregation of previous sentences for unrelated convictions.
Appellant bases his argument solely on language contained in an opinion issued by the Attorney General which stated: "In our opinion, the law does not permit a judge to commit a defendant to a local detention facility for more than eighteen months, even if that period of confinement derives from consecutive sentences, rather than a single sentence." 81 Op. Att'y Gen., No. 96-029 (Sept. 13, 1996) (unpublished). Appellant's reliance on this language is misguided.
The question presented to the Attorney General in 1996 was: "[W]hether a defendant can be sentenced to a local detention facility for consecutive sentences under the following circumstances: no single sentence exceeds eighteen months, but the total time to be served exceeds eighteen months." 81 Op. Att'y Gen., No. 96-029 (Sept. 13, 1996) (unpublished).[5] This question *447 does not address the particular factual situation extant in the case sub judice. As the State posits: "This question does not address the sentence at issue in the present case as the response contemplates that the consecutive sentences `to be then executed' derive from the same disposition. Th[e] opinion does not call for the aggregation of unrelated sentences received at different times and for separate convictions."
Discussing the sentencing limit, the 1996 Attorney General opinion looked to an earlier opinion: "In 68 Opinions of the Attorney General 194 (1983), Attorney General Sachs interpreted the predecessor to Article 27, § 705(g). At the time, the provision was codified as § 705F, applicable to `regional detention centers,' but was otherwise identical." 81 Op. Att'y Gen., No. 96-029 (Sept. 13, 1996) (unpublished). Addressing the 1983 opinion, the Attorney General stated in 1996:[6]
"The Attorney General was asked whether `the law permit[ted] a court to sentence an offender to a regional detention center for a period in excess of 18 months  the limit specified in Article 27, § 705F.' Discussing the legislative history, Attorney General Sachs noted that language in question differed from that in the statute when it was originally enacted in 1968:
The language then was a[s] follows:
`[A] judge . . . may sentence a convicted offender to a Regional Detention Center . . . provided the sentence imposed is for a period of not more than 18 months.'
This change in § 705F was effected by  and was the express purpose of  Chapter 205, Laws of Maryland 1975.
The title of the Act states its purpose, in relevant part, as follows: `F[or] the purpose of repealing the provision that the length of the sentence imposed is a basis for determining that a convicted offender may be sentenced to a regional detention center; [and] providing that the length of the sentence to be executed is a basis for determining that a convicted offender may be sentenced to a regional detention center.'

68 Opinions of the Attorney General at 203. In concluding that no law permits a judge to commit an offender to a regional detention center for more than eighteen months, the Attorney General observed `that, by placing an 18-month limit on the sentence "to be then executed," the General Assembly intended the commitments to regional detention centers be limited to 18 months or less of actual confinement.' Id. See also Minovich v. State, 18 Md.App. 368, 375, 306 A.2d 642 (1973). We are aware of no development in the law since 1983 that would cause us to reach a different conclusion.
"However, the eighteen-month limit on sentence length in § 705(g) applies only to the act of sentencing. 68 Opinions of the Attorney General at 204. This limit, Attorney General Sachs wrote, is not `a flat prohibition against the incarceration of an offender with a sentence of more than 18 months in a [local] detention center.'
Indeed, § 705E [now § 705(f)] provides that State prisoners may be housed in [local] detention centers pursuant to agreement between the Commissioner of Correction and the *448 jurisdictions administering the regional detention center. Nothing in § 705 imposes any limit  as to length of sentence or otherwise  on the category of State prisoners that may, by agreement, be housed in [local] detention centers. Similarly, State inmates with sentences of more than 18 months actual confinement may be transferred to regional detention centers pursuant to the provisions of Article 27, § 690(e) or § 700(c)."

81 Op. Att'y Gen., No. 96-029 (Sept. 13, 1996) (unpublished) (emphasis added) (footnote omitted).
The Attorney General's opinion upon which appellant bases his entire argument clearly does not attempt to opine that the holding of inmates in local correctional facilities for periods in excess of eighteen months is entirely proscribed. It simply clarifies that, pursuant to § 9-105, a trial judge may not sentence a convicted individual to a local correctional facility if the sentence to be then executed is for a period of more than eighteen months.
The sentencing in the case sub judice was made pursuant to a plea agreement between appellant and the State. As stated supra, appellant pled guilty to first degree escape  a violation of § 9-404 of the Criminal Law Article. The penalty on conviction for such a violation is up to ten years. The sentence then executed based upon the plea agreement was eighteen months  within the provisions of § 9-105. Maryland Code (2002), § 9-407 of the Criminal Law Article, however, stipulates that "[a] sentence imposed for a violation of § 9-404 . . .:(1) shall be consecutive to any term of confinement being served or to be served at the time of the escape." Therefore, the trial judge was mandated to run the eighteen-month sentence for first degree escape consecutive to appellant's one-year unrelated sentence for violation of probation in relation to the prior second degree assault conviction.

IV. Conclusion
We hold that § 9-105 of the Correctional Services Article, by its plain language, provides that trial judges may sentence an individual to a local correctional facility if the sentence to be then executed is for a period of not more than eighteen months. Section 9-105 does not prohibit a trial judge from imposing a sentence consecutive to a sentence for a prior unrelated conviction and sentence. Therefore, we hold that the eighteen-month sentence to run consecutive with appellant's prior unrelated one-year sentence in the local correctional facility was proper. We affirm the judgment of the Circuit Court for Frederick County.
JUDGMENT OF THE CIRCUIT COURT FOR FREDERICK COUNTY AFFIRMED WITH COSTS.
NOTES
[1]  Maryland Code (2002, 2005 Supp.), § 9-404 of the Criminal Law Article states in pertinent part:

"(a) Prohibited  In general.  A person may not knowingly escape from a place of confinement.
. . .
(c) Penalty.  A person who violates this section is guilty of the felony of escape in the first degree and on conviction is subject to imprisonment not exceeding 10 years or a fine not exceeding $20,000 or both."
[2]  With our resolution of the issue presented we need not address other arguments put forth by the parties.
[3]  This sentence was due to appellant's violation of probation which was imposed for a June 3, 2002, guilty plea to second degree assault.
[4]  As evidenced in oral argument, appellant does not argue that the sentence itself is illegal, just that he cannot be sentenced to serve the eighteen months  consecutive to the one-year term already imposed for a previous offense  in a local correctional facility. Appellant contends that he should be in a Department of Corrections facility.
[5]  The opinion of the Attorney General discussed Maryland Code (1957, 1996 Repl.Vol.), Art. 27, § 705(g), the predecessor rule to § 9-105, however, the language is the same in both provisions considered.
[6]  We include a significant part of the Attorney General's opinion on the issue because it is the sole stated basis for the appellant's position.
