Ho w late can I fund a SEP IRA if the tax is extended

I plan to get an extension on my taxes.  I am an LLC filing as an S-Corp, with everything flowing through personally.  I am hoping to be able to fund my SEP later in the year, prior to paying my final taxes, which I will do around October 15th.  How late can I fund a SEP for the prior tax year (2016)?