of unused credit Section 30D of the Internal Revenue Code of 1986 is amended by redesignating subsection (g) (as amended by subsection (a)(2)) as subsection (h), and by inserting after subsection (f) the following new subsection: (g) Carryforward of unused credit (1) In general If the credit allowable under subsection (a) (after the application of subsection (e)) exceeds the limitation imposed by section 26(a) for such taxable year reduced by the sum of the credits allowable under this subpart (other than subsection (a) of this section), such excess shall be carried to the succeeding taxable year and treated as a credit allowable under subsection (a) for such succeeding taxable year. (2) Limitation No amount of credit may be carried forward under this subsection to any taxable year following the 5th taxable year after the taxable year in which the credit arose. For purposes of the preceding sentence, credits shall be treated as used on a first-in, first-out basis. . (d) Effective dates (1) Extension The amendments made by subsection (a) shall apply to vehicles acquired after December 31, 2017. (2) Assignment The amendments made by subsection (b) shall apply to vehicles acquired more than 60 days after the date of the enactment of this Act. (3) Carryforward The amendments made by subsection (c) shall apply to vehicles sold after the date of the enactment of this Act. 3. Extension of the alternative fuel vehicle refueling property credit (a) In general Section 30C(g) of the Internal Revenue Code of 1986 is amended by striking 2017 and inserting 2028 . (b) Effective date The amendment made by this section shall apply to property placed in service after December 31, 2017. 4. Extension of the alternative motor vehicle credit (a) In general Paragraph (1) of section 30B(k) of the Internal Revenue Code of 1986 is amended by striking 2017 and inserting 2028 . (b) Effective date The amendment made by this section shall apply to property placed in service after December 31, 2017.