Do NOT go by the date that immigration stamp on your passport. I learned this the hard way. Always count it out yourself. Immigration stamped my passport for 31 days not 30 on a border run I did. Cost me a 500baht fine and an overstay stamp 😡😡😡