Date of expiration, I did it 3 weeks ago BUT don’t go to the immigration until 2 weeks from the date your supposed to leave. I was early and sent away !
Just get a 60 day tourist visa from the embassy, you can then extend your stay by a another 30 days by applying at the immigration office where your staying giving you 90 days in Thailand