I have a timestamp in my DB (in the '2010-02-16 23:27:15' format) I need to compare to the current time, and set a variable based on whether at least a week has passed since the DB record was inserted. Something like this:
get the stamp from the DB
if( record was inserted less than 7 days ago ) {
$expired = false;
} else {
$expired = true;
}
In an attempt to pull the DB timestamp and convert it to a UNIX time to do the comparison, I've tried several combinations of date(), time(), and mktime() with no success. What function(s) should I use to get this done?