Your tourist visa is valid until your passport is stamped on the last second of the very last day. It does not matter the time of your flight. If you leave it until the last minute, however, note that immigration can often have long queues.