I get a timestamp as a result of executing a query. EG:2006-01-09 15:36:26. I need to compute the diffrence between the current time and this timestamp. The function should return false if the difference is more than 30 minutes.
If by chance you have available the actual time in milliseconds I'd see if the difference is greater than 30*60*1000. If you just have a timestamp available in that format which you need to parse I'd go with what's already mentioned.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database