So, 12/31/2020 is okay to still be in it, and thus the UK is in the EU for another year plus 10 days. Got it.
There will be a transition period of one year to negotiate final Brexit departure arrangements.
UK will remain in the single market and European free trading zone from February 1 onwards but will be outside EU political institutions.
The UK is a member only until 31 January 2020.
It keeps the privileges and responsibilities during the transition period which is up to end 2020 but can be concluded earlier.
So Brexit happens at the end of January 2020