The timestamp in blocks can be interfered with, so what happens if someone puts a block 20m forward in time? Would this cause your app to trust all transactions for the next 10 minutes? As DeathByTaxes said, confirmations are where it counts. Satoshi's whitepaper has C++ code to determine the % likelyhood of an attacker being able to orphan a transaction with n confirmations by producing a chain with greater difficulty than the present one.. You need to wait 3 confirmations for ~99% certainty the chain wont be orphaned (if the attacker controls 10% of the hashrate - 15 confirmations if they control 30!)
So this could be exactly what you need

Given a hashrate that you get from blockchain, continue calculating the percentage likelyhood an attacker can orphan a transaction X blocks deep, and stop when your probability is 0.01 - X is now the number of confirmations needed or 99% certainty.
Multiply this by the current average block time (from blockchain) and you have your answer.