Appeal from a judgment of the Supreme Court (Teresi, J.), entered May 23, 2011 in Albany County, which dismissed petitioner’s application, in a proceeding pursuant to CPLR article 78, to review a determination of respondent calculating petitioner’s jail time credit.
On January 4, 2002, petitioner was sentenced as a second felony offender to a prison term of 5 to 10 years for his conviction of criminal sale of a controlled substance in the third degree. Petitioner was received by the Department of Corrections and Community Supervision on January 18, 2002 and credited with 240 days of jail time credit. Subsequently, petitioner was convicted of attempted kidnapping in the first degree and, in January 2006, was sentenced as a second felony offender to a prison term of eight years followed by five years of postrelease supervision. After the Department issued a computation which calculated petitioner’s dates for parole eligibility, conditional release and maximum release, petitioner commenced this CPLR article 78 proceeding to challenge the computation of his jail time credit. Supreme Court dismissed the petition and petitioner appeals.
We affirm. Initially, contrary to petitioner’s contention, his 2006 sentence was required to run consecutively to his 2002 sentence by operation of law (see Penal Law § 70.25 [2-a]; People ex rel. Randall v Walsh, 81 AD3d 1015, 1016 [2011]; Matter of Lagas v New York State Dept. of Correctional Servs., 78 AD3d 1344, 1345 [2010], lv denied 16 NY3d 703 [2011], cert denied 563 US —, 131 S Ct 2951 [2011]). With regard to the jail time credit that petitioner alleges he was denied, such credit is authorized for time spent in custody prior to the commencement *977of a sentence that is the result of the charge that culminated in the sentence, but shall not include any time credited against a previously imposed sentence (see Penal Law § 70.30 [3]; Matter of Neal v Goord, 34 AD3d 1142, 1143 [2006]; Matter of Villanueva v Goord, 29 AD3d 1097, 1098 [2006]). Inasmuch as the time petitioner spent in local custody between August 2004 and January 2006 was properly credited to his 2002 sentence, we find no error in the calculation of his release dates and, therefore, the petition was properly dismissed (see Matter of Hot v New York State Dept. of Correctional Servs., 79 AD3d 1383, 1384 [2010], lv denied 16 NY3d 710 [2011]). “To the extent that petitioner contends that he was denied the benefit of his plea bargain, his remedy is to seek whatever postconviction relief may be available to him in the form of a CPL article 440 motion” (Matter of Brown v Fischer, 71 AD3d 1316, 1317 [2010]).
Mercure, A.PJ., Lahtinen, Kavanagh, McCarthy and Garry, JJ., concur. Ordered that the judgment is affirmed, without costs.