Opinion op the Court by
Chief Justice Hurt—
Granting writ of prohibition.
One Dewey Drowns was convicted of the offense of chicken stealing, and his punishment fixed at confinement in the penitentiary for the period of one year. The trial occurred in the Graves circuit court on the 25th day of November, 1921, and Drowns was convicted upon a plea of guilty. He entered no motion for a now trial, but tbe court did not sentence him, nor render judgment upon the verdict until the 23rd day of December, 1921, upon which day he was taken in custody by the sheriff and delivered *28to officers of the penitentiary, at Eddyville, to commence the execution of the penalty imposed .upon him by the judgment. He has been of g’ood behavior, and is entitled to a credit .upon the term for which he was sentenced of seven days for each month of his term, as provided by the rules adopted by the State Board of Charities and Correction's for the government of the prisons. This will entitle Drowns to be discharged from the prison on the 17th day of October, 1922. Drowns, however, insists, that he should receive credit upon the duration of his term, by the 28 days, between his conviction by the jury on the 25th of November, and the 23rd day of December, when judgment was rendered upon the verdict, and during which time he was presumably confined in the county jail of Graves county, which credit would cause his term to end on September 2'2nd, 1922. On the 22nd day of September, he filed a petition before the county judge of Lyon-county, wherein the prison in which he is incarcerated, is situated, .setting forth the facts above stated, and making the above contention, -and insisting that he is being unlawfully detained in prison by the warden of that institution, and praying that a writ of habeas corpus be issued in his behalf directed to the warden, and upon a hearing that he be discharged from prison. The writ was issued, but, before any further proceedings the Attorney General filed this action seeking to prohibit the county judge from hearing the writ or discharging Drowns from custody of the prison authorities.
The petition filed before the county judge seeking the writ of habeas corpus, shows upon its face, that Drowns was adjudged guilty of the crime of chicken stealing on the 23rd day of December, 1921, and as a penalty for same to one year’s confinement at hard labor in the State Penitentiary at Eddyville, and that in pursuance of the judgment he was delivered to the penitentiary on the day of the date of the judgment. There is no pretense that under the rules adopted by the Board of Charities and Corrections, that the credits allowed for good conduct, are sufficient to diminish the time of Ms imprisonment, so that he is now or was on the 22nd of September, entitled to be discharged, and whether a writ of habeas corpus would now be an appropriate remedy in his behalf depends altogether, on whether his detention in prison is now illegal and unauthorized. A writ of habeas corpus can be invoked to release from or interfere with the custody of a prisoner, only, when he is illegally held in cus*29tody and if the imprisonment is lawful the writ is unavailable. Section 399, Criminal Code; Board of Prison Commissioners v. Crumbaugh, 161 Ky. 540; Commonwealth v. Minor, Judge, 195 Ky. 106. In Commonwealth v. Minor, Judge, supra, it was said: “In Bethuram v. Black, 11 Bush 628, it was held that the writ of habeas corpus was a discretionary writ and. should be issued only when probable cause for it is shown, and if upon the face of the petition therefor, it appears that there was no sufficient grounds for the release of a person in custody, the writ should be denied.” As a matter of course, if a judgment under which one is imprisoned is void, the habeas corpus is an appropriate remedy, but, there is no pretense here that the judgment under which Drowns is held is other than a valid judgment. The court, which rendered it, had jurisdiction to -do so. This Would seem to set at rest the legality of his imprisonment until, by time, the expiration of his term is reached. If the county judge should proceed to'clischarge the prisoner-under a writ of habeas corpus, he would thereby annul and set aside the judgment of the circuit court, which he has not jurisdiction to do. The application showing upon its face, that the detention was legal, the writ should have been denied.
The contention, however, is made, that the term of imprisonment in the penitentiary does not begin, at the time of the rendition of the judgment, but, begins at the time of the conviction by the jury, and for that reason the term expired one year from November 25th, instead of December 23rd, and that the court negligently failed to render judgment for 28 days, for which Drowns should have credit upon the sentence pronounced. Section 283, Criminal Code, provides that where there is a conviction for a felony, upon a plea of guilty, that the court may at once pronounce judgment, but, the language shows dearly that'this is not mandatory, but, is a matter about which the court may exercise a legal discretion, and there is nothing here to indicate that the court abused its discretion in deferring judgment until the time' of its rendition. That a court may not indefinitely defer rendering judgment and keep a convicted person in prison, or defer it to an unreasonable time is apparent without argument, but, an immemorial custom of the courts, in the country, when the prisoner does not demand an earlier sentence, is to defer the rendering of judgments upon persons convicted of felonies until a day toward the end of the term *30of court, and pass sentence upon all those convicted of crime's at one time. This is done more frequently for the benefit of tie convicts, to enable them to move for and prepare grounds for new trials, to see their friends and arrange their affairs preparatory to an absence from home for considerable periods of time. The convenience of the sheriff must, also, be looked to, who can not spend a great portion of luis time in conveying convicts to the penitentiary and return during term's of court, without neglect of bis other duties to the public, and at great cost to tbe 'Commonwealth if sentence is pronounced upon convicts from time to time. That tbe term of ‘a convict begins, in tbe penitentiary not earlier, at least, than tbe rendition of tbe judgment is apparent, when it is considered that a valid final judgment is tbe only authority for tbe imprisonment in tbe penitentiary, as there is no other means of getting one in tbe penitentiary, except toaren tbe sheriff with a certified copy of tbe judgment, and no other warrant or authority is necessary. Tbe judgment is not accompanied by the record, so that tbe date of tbe verdict may be known, as that is immaterial. Tbe temporary writ of prohibition is therefore made permanent and tbe defendant enjoined from proceeding any further under the writ of habeas corpus, or interfering with tbe custody of the prisoner.