We had a minor, unpleasant surprise when flying out of Indonesia. We double-checked the dates ahead of time and picked a flight on the 30th day of our visa. Despite the preparation, once we arrived at the border control desk in Jakarta airport we were informed that we'd overstayed our visa.
There were two immigration officers, one good-cop low on english skills and one smooth-talker who was the bad-cop. They took us into a tiny office, scanned our passports, and showed us the computer readout... sure enough, the computer claimed we were in Indonesia for 31 days. They tried to tell us that it was because January has 31 days, and I understand that it's a common misconception. People mistakenly think they can leave on the same date the next month, assuming it's 30 days later. But we arrived on January 14th and left on February 13th.
They explained that the day you arrive is day number one, even if you stamp in at 23:59. Bummer. Can't really argue with policy.
After haggling for a while and trying to lower or eliminate our fine, we eventually made one more trip to the airport ATM and paid the fee of 300,000 IDR per person. On the bright side, we'd looked up tickets for Feb 12 and they had cost about 400,000 IDR more per person, so this was still a cheaper way to leave the country. But it was unexpected, and felt wrong.
We showed them the numerous stamps in our passport that have explicit exit dates, and suggested that they could communicate to a superior that supplying this information is helpful to tourists.
Bottom line, when you calculate your departure date, look up 29 days after your arrival, not 30. Or ask the immigration officer the exact date you must leave when you stamp in. Or just leave one day early to be safe 😁