Check Date time Expire

Hi All,

  I am having download link. Download date & time will be stored when user clicks that link. Expire period 1 day. Now i have to check whether that link s expired or not.  

dt=“18:17:18” // download time
dd=“2010-03-17”; //download date

I have used strtotime, but i have am/pm confusions… any one knows other simple methods plz suggest.

You may want to take a look at this thread:
http://www.trap17.com/index.php/Adding-Day-Date_t33676.html

This is assuming you have the download time in $dt and $dd.

$dt="18:17:18" // download time
$dd="2010-03-17"; //download date

$downloadTS = strtotime("$dd $dt");
$expireTS = strtotime("-24 hours");

if($downloadTS < $expireTS) {
  // download expired!
}

OR you can do time math…

$dt="18:17:18" // download time
$dd="2010-03-17"; //download date

$downloadTS = strtotime("$dd $dt");
$expireSec = 24*60*60;
if(time() - $downloadTS > $expireSec) {
  // download expired!
}

strtotime(+24 hours) works fine… thanks a lot… thanks for all…