
19 Ariz. App. 339 (1973)
507 P.2d 678
The STATE of Arizona, Appellee,
v.
Gregory GORDON, Appellant.
No. 2 CA-CR 310.
Court of Appeals of Arizona, Division 2.
March 20, 1973.
Rehearing Denied April 26, 1973.
Review Denied May 22, 1979.
*340 Gary K. Nelson, Atty. Gen. by Thomas A. Jacobs, Asst. Atty. Gen., Phoenix, for appellee.
Ed Bolding, Pima County Public Defender by Richard Van Duizend, Asst. Public Defender, Tucson, for appellant.
KRUCKER, Judge.
From a sentence of two to four years imposed upon the defendant after entry of judgment of conviction of grand theft, this appeal follows.
The events which took place in chronological order are as follows. On June 3, 1971, a criminal complaint was filed against the defendant charging him with one count of armed robbery. After appearing in Justice Court and posting a surety bond, he was released to his parents, who live in California, upon several conditions set forth in a form which he signed.
On June 14, 1971, after a preliminary hearing was held, defendant was bound over to superior court. On July 6, 1971, defendant was arraigned in superior court and entered a plea of not guilty. At this time the conditions of his bond were reiterated and he was allowed to remain at liberty pending his trial set for January 25, 1972.
What follows is a bit confusing; however, we will endeavor to set forth the facts with as much clarity as the record will allow. It appears that shortly after his arraignment he traveled to Illinois, where he was charged by Iowa authorities with grand theft and burglary, said charges arising out of an incident occuring near the Illinois-Iowa border. He was convicted and placed on probation by Iowa authorities for a period of 17 months and was also sentenced to some prison time in Illinois. (Apparently the two states had a reciprocal agreement and the offenses took place in both states.)
Defendant was returned to Tucson, Arizona, on May 31, 1972, where he remained in custody not being able to re-post the $1,500 bond. Trial was set for July 26, 1972, at which time the defendant plead guilty to the reduced charge of grand theft. He was sentenced to serve a term of not less than two nor more than four years, said time to run from the date of sentencing. He was twenty years old at the time of sentencing.
On appeal the defendant contends:
1. That his sentence was excessive in view of his age, character and past conduct.
2. That the trial court's refusal to give him credit for time spent in custody prior to trial in and of itself constituted an excessive sentence, placed him in jeopardy twice for the same offense and violated his right to equal protection under the law.

EXCESSIVE SENTENCE
This court has stated on numerous occasions that the length of a sentence is within the discretion of the trial court. State v. Scott, 11 Ariz. App. 68, 461 P.2d 712 (1969) and cases cited therein. When *341 a sentence is within the statutory limits, it will be set aside only where there is an abuse of the lower court's discretion. See, State v. Lerch, 107 Ariz. 529, 490 P.2d 1 (1971) and cases cited therein. In determining whether there was such an abuse, the court must consider the purpose of the sentence and the objectives sought to be accomplished, i.e., retribution, restraint, deterrence and rehabilitation. State v. Howland, 103 Ariz. 250, 439 P.2d 821 (1968). In the case at bar, the trial court had before it the probation officer's report, the results of psychological testing and the knowledge of a similar crime previously committed. In light of the above, we are of the opinion that the trial court did not abuse its discretion.

FAILURE TO GIVE DEFENDANT CREDIT FOR TIME SERVED
As in determining whether a sentence is excessive, our Supreme Court has held that the crediting of jail time served prior to sentencing is a matter of judicial discretion. State v. Kennedy, 106 Ariz. 190, 472 P.2d 59 (1970); State v. Van Winkle, 106 Ariz. 481, 478 P.2d 105 (1970); State v. Rider, 18 Ariz. App. 361, 501 P.2d 1202 (1972). We must presume that the trial court took into consideration all factors, including the amount of time served in the county jail up to the date of sentencing. State v. Kennedy, supra. Merely because the trial court failed to credit jail time served, as defendant apparently argues, cannot in and of itself result in an excessive sentence.
Defendant relies upon North Carolina v. Pearce, 395 U.S. 711, 89 S.Ct. 2072, 23 L.Ed.2d 656 (1969) in support of his position that he was subjected to double jeopardy. This same question was before our Supreme Court in Kennedy and Van Winkle. In distinguishing Pearce, our Supreme Court stated:
"... the question [in North Carolina v. Pearce] was not whether a defendant should be given credit for time spent in jail before the first trial, but whether he could be given a longer sentence after his second trial and whether he is entitled to time spent in prison while his case was on appeal." 478 P.2d at 107.
As to his contention that he had been denied his right to equal protection in violation of the United States Constitution, defendant relies on Parker v. Bounds, 329 F. Supp. 1400 (E.D.N.C. 1971). This contention would warrant serious consideration had the actual sentence imposed, plus the time spent in jail prior to sentence, exceeded the maximum sentence that the law allows. The law is clear, however, that if the actual sentence imposed plus the time spent in jail does not exceed the maximum sentence which could be imposed, it will be conclusively presumed that the sentencing court gave the defendant credit for the pre-sentence time spent in confinement. Schreter v. Clark, 457 F.2d 1305 (5th Cir.1972); People v. Jones, 489 P.2d 596 (Colo. 1971); c.f., State v. Kennedy, supra. Such being the case, the "equal protection" argument fails. The Parker case and others which we have read where the court has struck down the sentence as a denial of equal protection involved fact situations where the defendant would, in effect, serve more than the statutory sentence.
For the foregoing reasons, we affirm.
HATHAWAY, C.J., and HOWARD, J., concur.
