I am writing a new auction script for my website and I have everything working except closing the auctions.
I have the database set up to record the start time like this:
Field Type Default
time datetime 0000-00-00 00:00:00
I need a way to close auctions after 10 days. I am assuming the best way to do this is to set up a cron job that will close all auctions that are 10 days old. My only problem is I don't know how to write the code the find the 10 day cutoff. I know I need to somehow take today's day and subtract 10 days from it but I can't seem to find out how.
My plan is once I find that code I will then take that variable and compare it to the time in the database with >. Is there a better way?
can anyone help?