26 USC 6513 - Time return deemed filed and tax considered paid

(a) Early return or advance payment of tax 
For purposes of section 6511, any return filed before the last day prescribed for the filing thereof shall be considered as filed on such last day. For purposes of section 6511 (b)(2) and (c) and section 6512, payment of any portion of the tax made before the last day prescribed for the payment of the tax shall be considered made on such last day. For purposes of this subsection, the last day prescribed for filing the return or paying the tax shall be determined without regard to any extension of time granted the taxpayer and without regard to any election to pay the tax in installments.
(b) Prepaid income tax 
For purposes of section 6511 or 6512
(1) Any tax actually deducted and withheld at the source during any calendar year under chapter 24 shall, in respect of the recipient of the income, be deemed to have been paid by him on the 15th day of the fourth month following the close of his taxable year with respect to which such tax is allowable as a credit under section 31.
(2) Any amount paid as estimated income tax for any taxable year shall be deemed to have been paid on the last day prescribed for filing the return under section 6012 for such taxable year (determined without regard to any extension of time for filing such return).
(3) Any tax withheld at the source under chapter 3 shall, in respect of the recipient of the income, be deemed to have been paid by such recipient on the last day prescribed for filing the return under section 6012 for the taxable year (determined without regard to any extension of time for filing) with respect to which such tax is allowable as a credit under section 1462. For this purpose, any exemption granted under section 6012 from the requirement of filing a return shall be disregarded.
(c) Return and payment of social security taxes and income tax withholding 
Notwithstanding subsection (a), for purposes of section 6511 with respect to any tax imposed by chapter 3, 21, or 24
(1) If a return for any period ending with or within a calendar year is filed before April 15 of the succeeding calendar year, such return shall be considered filed on April 15 of such succeeding calendar year; and
(2) If a tax with respect to remuneration or other amount paid during any period ending with or within a calendar year is paid before April 15 of the succeeding calendar year, such tax shall be considered paid on April 15 of such succeeding calendar year.
(d) Overpayment of income tax credited to estimated tax 
If any overpayment of income tax is, in accordance with section 6402 (b), claimed as a credit against estimated tax for the succeeding taxable year, such amount shall be considered as a payment of the income tax for the succeeding taxable year (whether or not claimed as a credit in the return of estimated tax for such succeeding taxable year), and no claim for credit or refund of such overpayment shall be allowed for the taxable year in which the overpayment arises.
(e) Payments of Federal unemployment tax 
Notwithstanding subsection (a), for purposes of section 6511 any payment of tax imposed by chapter 23 which, pursuant to section 6157, is made for a calendar quarter or other period within a calendar year shall, if made before the last day prescribed for filing the return for the calendar year (determined without regard to any extension of time for filing), be considered made on such last day.