
404 S.E.2d 415 (1991)
STATE of West Virginia ex rel. Benjamin ROACH, Petitioner,
v.
Jerry DIETRICK, Superintendent, Eastern Regional Jail, Respondent.
No. 20005.
Supreme Court of Appeals of West Virginia.
Submitted April 2, 1991.
Decided April 17, 1991.
*416 David H. Sanders, Public Defender Corp., Martinsburg, for petitioner.
Diana Cook Risavi, Pros. Atty., Martinsburg, for respondent.
MILLER, Chief Justice.
The petitioner, Benjamin Roach, seeks a writ of habeas corpus to obtain his release from the custody of the Department of Corrections. The petitioner was indicted for attempted aggravated robbery. On February 4, 1991, he pled guilty to second offense petit larceny, a felony that carries a mandatory sentence of one year in the penitentiary. See W.Va.Code, 61-11-20 (1923).[1] He was given good time credit for the time served while in pretrial detention, which made his effective sentencing date August 4, 1990. He was ordered committed to the Department of Corrections and was temporarily lodged in the Eastern Regional Jail in Martinsburg, West Virginia.
On the next day, February 5, 1991, the Department of Corrections, pursuant to W.Va.Code, 28-5-27(c) (1984), credited the petitioner a day of good time for each day he was incarcerated and ordered his release from confinement.[2] Without a hearing, the circuit court directed that the petitioner remain incarcerated, but stayed its order pending resolution of this proceeding.[3]
*417 In 1984, the good time credit provisions of W.Va.Code, 28-5-27(c), were liberalized.[4] These provisions apply to inmates committed to the custody of the Commissioner of the Department of Corrections. The statute states that the good time credit includes "any and all days in jail awaiting sentence and which is credited by the sentencing court ... to [the] sentence" pursuant to W.Va.Code, 61-11-24.[5]
The circuit court credited the petitioner's presentence confinement in the county jail against his one-year penitentiary sentence as allowed under W.Va.Code, 61-11-24. This credit made the effective date of his sentence August 4, 1990. According to the Department of Corrections' computations, the petitioner served six months of his sentence in jail and obtained six months of good time credit under the statute. With the credit for good time served, the petitioner became eligible for release on February 5, 1991.
The respondent argues that the legislature did not intend such a result under W.Va.Code, 61-11-20, when it enacted W.Va.Code, 28-5-27(c). We reject this argument on several grounds. First, because W.Va.Code, 28-5-27(c), is not ambiguous, we need not ascertain the legislative intent. Applying our traditional rule, we will look at the plain meaning of a statute, as set out in Syllabus Point 2 of Stowers & Sons Trucking Co. v. Public Service Commission, ___ W.Va. ___, 387 S.E.2d 841 (1989):
"`Where the language of a statute is clear and without ambiguity the plain meaning is to be accepted without resorting to the rules of interpretation.' Syllabus Point 2, State v. Elder, 152 W.Va. 571, 165 S.E.2d 108 (1968)."
Second, as we stated, in Syllabus Point 5 of Pullano v. City of Bluefield, ___ W.Va. ___, 342 S.E.2d 164 (1986):
"`The Legislature, when it enacts legislation, is presumed to know its prior enactments.' Syllabus Point 12, Vest v. Cobb, 138 W.Va. 660, 76 S.E.2d 885 (1953)."
Finally, we believe that the legislature, when it enacted the 1984 amendment to W.Va.Code, 28-5-27(c), to include "all days in jail awaiting sentence and which is credited... to [the] sentence" under W.Va. Code, 61-11-24, must have been aware that this language would shorten the ultimate sentence by providing presentence jail time credit. The statutory good time credit scheme even directly refers to W.Va.Code, 61-11-24, which relates to credit for presentence detention.
We, therefore, conclude that a person who has been incarcerated in jail awaiting sentence and is then sentenced to the custody of the Commissioner of the Department of Corrections and is credited with presentence jail time under W.Va.Code, 61-11-24, is also entitled to receive good time credit under W.Va.Code, 28-5-27(c), for the presentence jail time.
*418 The trial court's decision to thwart the Department of Correction's adherence to W.Va.Code, 28-5-27(c), by ordering the petitioner's continued incarceration was an act which exceeded its lawful authority.[6] In Syllabus Point 1 of State ex rel. Vandal v. Adams, 145 W.Va. 566, 115 S.E.2d 489 (1960), we held:
"A writ of habeas corpus ad subjiciendum will lie to effect the release of one imprisoned in the State Penitentiary without authority of law." See also State ex rel. Harding v. Boles, 150 W.Va. 534, 148 S.E.2d 169 (1966); State v. Boles, 148 W.Va. 770, 137 S.E.2d 246 (1964).
For the foregoing reasons, a writ of habeas corpus will be awarded directing the respondent to release the petitioner from the custody of the Department of Corrections.
Writ granted.
NOTES
[1]  W.Va.Code, 61-11-20, states:

"When a person is convicted of petit larceny, and it is alleged in the indictment on which he is convicted, and admitted, or by the jury found, that he has been before sentenced in the United States for the like offense, he shall be sentenced to be confined in the penitentiary for the term of one year."
[2]  W.Va.Code, 28-5-27(c), provides:

"Each inmate committed to the custody of the commissioner of corrections and incarcerated in a penal facility pursuant to such commitment shall be granted one day good time for each day he or she is incarcerated, including any and all days in jail awaiting sentence and which is credited by the sentencing court to his or her sentence pursuant to section twenty-four [§ 61-11-24], article eleven, chapter sixty-one of this code or for any other reason relating to such commitment. No inmate may be granted any good time for time served either on parole or bond or in any other status whereby he or she is not physically incarcerated."
[3]  In an order dated February 8, 1991, we issued to the respondent a rule to show cause why he continued to incarcerate the petitioner. Moreover, we ordered the petitioner released on bond pending our decision.
[4]  In Hasan v. Holland, ___ W.Va. ___, 342 S.E.2d 144 (1986), we discussed how the 1984 amendment changed the previous statute. 1984 W.Va.Acts ch. 46.
[5]  W.Va.Code, 61-11-24, states:

"Whenever any person is convicted of an offense in a court of this State having jurisdiction thereof, and sentenced to confinement in jail or the penitentiary of this State, or by a justice of the peace [magistrate] having jurisdiction of the offense, such person may, in the discretion of the court or justice [magistrate], be given credit on any sentence imposed by such court or justice [magistrate] for the term of confinement spent in jail awaiting such trial and conviction."
In Syllabus Point 1 of Martin v. Leverette, 161 W.Va. 547, 244 S.E.2d 39 (1978), based on North Carolina v. Pearce, 395 U.S. 711, 89 S.Ct. 2072, 23 L.Ed.2d 656 (1969), we concluded that such credit was mandatory: "The Double Jeopardy and Equal Protection Clauses of the West Virginia Constitution require that credit for time spent in jail, either pre-trial or post-trial, shall be credited on an indeterminate sentence where the underlying offense is bailable." In Martin, the sentence under consideration was indeterminate; however, this same rule also applies to a determinate sentence. Constitutional protections are implicated because a person who is unable to make bail will be incarcerated before trial. If such person is not given credit for the jail time, a longer period of incarceration will occur than for the person who commits the same offense but is released on pretrial bail.
[6]  The record reflects that at the hearing, the judge was aware of the possible impact of W.Va. Code, 28-5-27(c). The circuit court, prior to imposing the sentence, could have rejected the plea agreement under Myers v. Frazier, ___ W.Va. ___, 319 S.E.2d 782 (1984). Once the sentence was pronounced and executed, the circuit court did not have the power to increase the petitioner's penalty. See Sellers v. Broadwater, ___ W.Va. ___, 342 S.E.2d 198 (1986).
