select time difference in mysql query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

select time difference in mysql query

Post by yaron »

Hello all,

I need to get for a table the difference between the current time and a timestamp stored in the table.

Can I write something like this?

select dateinsert-now() from somewhere where dateinsert>now()-interval 15 minute

I need the diff in minutes.
Post Reply