MySQL: date interval

SELECT *, DATE_FORMAT(insertTimeStamp, '%d-%m-%Y') as insertDateTime
FROM table
WHERE insertTimeStamp BETWEEN DATE_SUB(NOW(), INTERVAL 1 MONTH) AND DATE_ADD(NOW(), INTERVAL 1 MONTH)

Leave a Reply