Latest date to file H1B in order to remain cap exempt.


My details are as follows.

1st H1B petition - Approved from oct 2013- oct 2016. Stamped.2nd H1B petition (different employer) - approved from 2015- 2016 Dec - Not stamped.Outside USA from apr 2016-sept 2016.Re-entered on H4. Just started working on H4 EAD, but due to the uncertainity surrounding this EAD, I am seeking H1B sponsorship. My current employer might, based on my performance, but that will take some time.My question is: till when do I have, in order to NOT be counted against the cap? October 2019? From when is the 6 years counted? thanks in advance.