[thelist] PHP Unix Timestamp

Anthony Baratta Anthony at Baratta.com
Thu Mar 29 16:20:56 CST 2001


At 01:57 PM 3/29/2001, you wrote:
>I'm playing ignorant this afternoon and am having too many brain 
>farts.  Can you give an example?

Sure!

## Find All insert dates with in the last month

SELECT * FROM db_table_name WHERE
insert_date between NOW() AND DATE_SUB(NOW(),INTERVAL 1 MONTH)

## Find All expire dates with in the next month

SELECT * FROM db_table_name WHERE
expire_date between NOW() AND DATE_ADD(NOW(),INTERVAL 1 MONTH)

More here:

http://www.mysql.com/doc/D/a/Date_and_time_functions.html


----
Anthony Baratta
President
Keyboard Jockeys





More information about the thelist mailing list