
75 P.3d 214 (2003)
139 Idaho 160
STATE of Idaho, Plaintiff-Respondent,
v.
Jason AKIN, Defendant-Appellant.
No. 28244.
Court of Appeals of Idaho.
July 28, 2003.
*215 Molly J. Huskey, State Appellate Public Defender; Charles Isaac Wadams, Deputy Appellate Public Defender, Boise, for appellant.
Hon. Lawrence G. Wasden, Attorney General; Lori A. Fleming, Deputy Attorney General, Boise, for respondent.
*216 LANSING, Chief Judge.
Jason Akin appeals from the judgment of conviction and sentence entered by the district court after Akin pleaded guilty to two counts of issuing a check without funds. Akin contends that the district court erred in denying his motion to withdraw his guilty plea. He also contends that the court abused its discretion by imposing an excessive sentence and that the court erred in calculating Akin's credit for time served.

I.

FACTUAL AND PROCEDURAL BACKGROUND
Akin was charged with five counts of issuing a check without funds, Idaho Code § 18-3106(a). Pursuant to a plea agreement, Akin pleaded guilty to two of these counts. In exchange for his plea of guilty, the State dropped the remaining three counts in this case and all charges in an unrelated case, district court case number CR2001-07593.
Before sentencing, but after the preparation of the presentence investigation report (PSI), Akin filed a motion to withdraw his guilty plea. The hearing on the motion was set to be heard at the time of sentencing. However, Akin did not appear for his sentencing, and a bench warrant was issued. Akin was later arrested in Florida and returned to Idaho. He then filed another motion to withdraw his guilty plea. At the hearing on the motion, Akin asked to withdraw his plea on the basis that he was not guilty of the crimes and that he had only pleaded guilty to take advantage of the plea agreement. The district court denied the motion, finding that Akin had not presented the court with a just reason for withdrawal of his plea. The district court sentenced Akin to a determinate term of three years on the first count and a consecutive indeterminate term of three years on the second count.
Akin then filed a motion requesting credit for time served in relation to the charges in case number CR2001-07593, which had been dismissed as part of the sentencing agreement. The district court denied the motion. Akin appeals.

II.

ANALYSIS

A. Motion to Withdraw Guilty Plea
We consider first Akin's assertion that the district court erred in denying his motion to withdraw the guilty plea. A trial court may allow the withdrawal of a guilty plea under Idaho Criminal Rule 33(c). Where the motion is made before sentencing, a defendant need only show a "just reason" to withdraw the plea. I.C.R. 33(c); State v. Ballard, 114 Idaho 799, 801, 761 P.2d 1151, 1153 (1988); State v. Hocker, 115 Idaho 137, 139, 765 P.2d 162, 164 (Ct.App.1988). A factor to be considered is whether the defendant's motion was made after having read the PSI and the sentencing recommendations presented there. State v. Howell, 104 Idaho 393, 397, 659 P.2d 147, 151 (Ct.App.1983). If a defendant has received the PSI before moving to withdraw a plea, then the court has the broad discretion to take into account the defendant's apparent motive in filing such a motion. State v. Johnson, 120 Idaho 408, 411, 816 P.2d 364, 367 (Ct.App.1991); Hocker, 115 Idaho at 139, 765 P.2d at 164. The motion may properly be denied if the defendant has failed to present and support a plausible reason for withdrawal of the plea, even absent prejudice to the prosecution. State v. Rose, 122 Idaho 555, 559, 835 P.2d 1366, 1370 (Ct.App.1992). The defendant has the burden to show that the withdrawal should be allowed, State v. Carrasco, 117 Idaho 295, 298, 787 P.2d 281, 284 (1990), and a denial order will not be reversed absent an abuse of discretion. State v. Lavy, 121 Idaho 842, 844, 828 P.2d 871, 873 (1992).
A declaration of innocence alone does not entitle a defendant to withdraw a guilty plea. State v. Knowlton, 122 Idaho 548, 549, 835 P.2d 1359, 1360 (Ct.App.1992). The Idaho Supreme Court has held that "a denial of factual guilt is not a just reason for the later withdrawal of the plea, in cases where there is some basis in the record of factual guilt...." State v. Dopp, 124 Idaho 481, 486, 861 P.2d 51, 56 (1993). If mere assertion of legal innocence were always a sufficient condition for withdrawal, withdrawal *217 would effectively be an automatic right. State v. Rodriguez, 118 Idaho 957, 960, 801 P.2d 1308, 1311 (Ct.App.1990). See also United States v. Barker, 514 F.2d 208, 221 (D.C.Cir.1975). In determining whether to grant or deny a defendant's withdrawal motion, a court must not only consider his assertion of innocence, but also the reasons why the claim of innocence was not maintained earlier. Rodriguez, 118 Idaho at 961, 801 P.2d at 1312.
In assessing the district court's disposition of Akin's motion, we begin by noting that Akin's first motion to withdraw his guilty plea was made after issuance of the initial PSI, which recommended incarceration. The district court was entitled to take this circumstance into account in assessing the genuineness of Akin's claimed motive for moving to withdraw his plea.
Akin contends that his assertion of innocence should be deemed a "just reason" for withdrawal of the plea. He asserts that the record contains no sufficient showing of a factual basis for the guilty plea because he had made no confessions to having committed the crimes.
The record does not support Akin's assertions. Before accepting Akin's pleas, the district court reviewed the facts surrounding each crime and advised Akin that by pleading guilty, he would be admitting that he committed the charged offenses. In an exchange between Akin and the court, Akin admitted to the State's allegations and told the court that he was pleading guilty because he did commit the crimes charged. Moreover, by the time of the hearing on Akin's motion for withdrawal of the plea, the court had before it an update to the PSI which, in a section titled "Defendant's Version," quoted verbatim Akin's statement on the presentence investigation questionnaire: "The reason I've committed this crime and every crime before is because I needed the money to fund my addiction.... The reason I went along with my co-defendant is because I wanted the money to buy drugs and alcohol." This amounted to a direct admission of guilt by the defendant.
After the district court orally denied his motion to withdraw the plea, Akin was permitted to again address the court. He then asserted for the first time that his principal reason for pleading guilty had been to protect his mother because, as a part of the plea bargain, the State was dismissing charges against her. Akin renews that argument on appeal. We find this assertion unconvincing, however, for the hearing in which Akin pleaded guilty was a joint hearing in which his mother also pleaded guilty to two charges, with other charges against her being dismissed. Thus, Akin's guilty plea did not prevent the prosecution of his mother.
On this record, we hold that the district court acted well within its discretion in determining that Akin had not shown a just reason for allowing withdrawal of his guilty plea.

B. Sentence
Akin was sentenced to a determinate term of three years' confinement on the first count and to a consecutive indeterminate term of three years on the second count. Contrary to the request of defense counsel, the court did not retain jurisdiction over Akin. Akin contends that these sentences are excessive and should either be reduced or made to run concurrently, or in the alternative, that the court should have retained jurisdiction.
Our standard for appellate review of a sentence is well settled. When a sentence is imposed within the maximum permitted for the offense, we review the sentence for an abuse of discretion. State v. Anderson, 103 Idaho 622, 623, 651 P.2d 556, 557 (Ct.App.1982). If the sentence is not illegal, the appellant has the burden to show that it is unreasonable, and thus a clear abuse of discretion. State v. Brown, 121 Idaho 385, 393, 825 P.2d 482, 490 (1992). A sentence may represent such an abuse if it is shown to be unreasonable upon the facts of the case. State v. Nice, 103 Idaho 89, 90, 645 P.2d 323, 324 (1982). A sentence of confinement is reasonable if it appears that the confinement is necessary "to accomplish the primary objective of protecting society and to achieve any or all of the related goals of deterrence, rehabilitation or retribution applicable to a given case." State v. Toohill, *218 103 Idaho 565, 568, 650 P.2d 707, 710 (Ct. App.1982).
Akin has a substantial criminal record, including several felonies, and has previously served time in prison. Akin's past criminal activities include burglary, forgery and theft. He had previously been placed in the retained jurisdiction program and had been on probation and on parole. His probation, and later parole, were revoked because he committed new crimes. Akin was on probation when he committed the present crime. In light of this record, we conclude that the sentence imposed by the district court is justified.

C. Credit for Time Served
Following the entry of judgment, Akin filed a pro se motion requesting credit for time served in relation to charges in case number CR2001-07593, charges which had been dismissed pursuant to the plea agreement. The district court denied the motion. On appeal, Akin contends that when a defendant pleads guilty pursuant to a plea agreement he should be entitled to credit for prejudgment time served on charges that were dismissed under the agreement. Accordingly, he claims entitlement to credit for nine months and two days of time served in jail on case number CR2001-07593.
Akin's argument is without merit. A defendant is entitled to credit for time served prior to the entry of judgment "if such incarceration was for the offense or an included offense for which the judgment was entered." I.C. § 18-309. Akin argues that the dismissed offense became a part of the present offenses by means of the plea agreement because without the plea agreement he could have received credit for time served in the other case. However, a defendant is not entitled to prejudgment incarceration credit if the incarceration was not "attributable to the charge or conduct for which a sentence is to be imposed." State v. Hale, 116 Idaho 763, 765, 779 P.2d 438, 440 (Ct.App.1989). The case for which Akin seeks credit has no connection to the instant offensesAkin's incarceration in CR2001-07593 began before the present bad check offenses were committed. The district court did not err in determining that Akin was not entitled to credit for time served on charges from an unrelated case which were dismissed pursuant to a plea agreement.
Akin also contends that the district court incorrectly calculated the credit for time served in the instant case. This assertion is well taken. The district court credited Akin with 102 days for prejudgment incarceration during the periods of August 8 through September 23, 2001 and December 6, 2001 through January 31, 2002. As Akin points out, the correct credit is 104 days. The district court may have arrived at its total of 102 days by excluding the first day of each period of incarceration. In doing so, the court may have had in mind the method for computing time periods for filing and serving documents prescribed by Idaho Criminal Rule 45(a), which excludes the day of the act or event that starts the period running.[1] We conclude that this is not an appropriate method, however, to compute credit for days of incarceration. Idaho Code § 18-309 requires that credit be given in a judgment of conviction for "any period of incarceration" served prior to entry of judgment. This can be accomplished only by counting every day during which the defendant served some period of confinement. Eliminating the first day of incarceration would preclude any credit for a defendant who was released before the midnight following his arrest. Such a result would not comply with the statutory mandate to give credit for any period of incarceration. Therefore, we hold that Akin's judgment should be amended to allow credit for 104 days.
Lastly, Akin contends that the district court erred when it stated that he was released from prejudgment incarceration on September 23, 2001 because the district *219 court's register of actions reflects that the bond was posted on September 24, 2001. Akin bases this argument exclusively upon the register of actions, which is generated by court staff and is not evidence. It is not apparent from the record what documents or other evidence the district court relied upon in determining the dates of Akin's prejudgment incarceration, nor is there any indication that Akin presented any evidence to the district court in support of his motion. The court may have referred to jail records or court records that are not in the record on appeal. This Court cannot say, based upon the register of actions, that the district court erred in determining the date of Akin's pretrial release. Akin has not demonstrated error in this regard on appeal.

III.

CONCLUSION
The district court did not commit error in denying Akin's motion to withdraw his guilty plea, nor did the court impose an excessive sentence or err by refusing to give Akin credit on his sentence for incarceration served in an unrelated case. Akin has shown error, however, in the district court's calculation of credit for time served in the present case. Therefore, on remand the judgment of conviction must be corrected to credit Akin with two additional days of prejudgment incarceration. The judgment of conviction and sentences are otherwise affirmed.
Judge PERRY and Judge GUTIERREZ concur.
NOTES
[1]  Idaho Criminal Rule 45(a) provides:

In computing the time period prescribed or allowed for the filing or service of any document in these rules, the day of the act or event after which such designated period of time begins to run is not to be included, but the last day of the period so computed is to be included....
