Here's an example (which I happened to have in my notes). It displays users who registered within the last seven days.
code:
SELECT U_Username,FROM_UNIXTIME(U_Registered),(UNIX_TIMESTAMP()-U_Registered)/(3600*24)
FROM w3t_Users
WHERE (UNIX_TIMESTAMP()-U_Registered)/(3600*24) < 7
The date/times in the database represent the number of seconds from the "epoch", which I think is Jan 1, 1970.
For more details, see
MySQL Date and Time Functions.