Mysql has many great date handling functions, but one that I don't see used very often is DATE_SUB, which is fantastic at handling time intervals.

For example, say you want to select all records from a table that has a date set more than 1 month old (compared to the current time).

SELECT * FROM table WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) > date_column

This assumes your date column is of type date, or datetime, although using FROM_UNIXTIME will allow you to work with timestamps as well.

The date_sub call, if ran on 2010-05-20, will return 2010-04-20. So if your date_column field has a date greater than this value, it is therefore more than 30 days old.

This is particularly handy when generating reports.