If you are using this with some sort of programming language such as with PHP
, then you could do something like the following:
$5_minutes_ago = date("Y-m-d H:i:s",
mktime(date("H"), (date("i") - 5), date("s"), date("m"), date("d"), date("Y"))
);
$sql = "SELECT * FROM my_timestamp > " . $5_minutes_ago;
Remember to set the date format in the first argument of date
according to the one you are using in your database. Use this as a reference.
The benefit of going this route is if your database is not using an actual timestamp format that MySQL understands. You could tweak the logic to output the format in whatever way you need for your MySQL query.