Get entry_date of entry

Hi, in general i’m making a wait list and after 60 days i’m sending out a notification email asking if they want to stay on the list. So I’m looking to automatically change an admin only radio button field after 90 days if they haven’t responded.

I don’t know how to get the entry date or how to update the radio button field to be selected but I currently have this for testing and I need some assistance with working this out better.

function dateDiffInDays($date1, $date2)
{
// Calulating the difference in timestamps
$diff = strtotime($date2) - strtotime($date1);

// 1 day = 24 hours 
// 24 * 60 * 60 = 86400 seconds 
return abs(round($diff / 86400)); 

}

$entrydate = rgar( $entry, ‘date_created’ );
$currentdate = date(“Y-m-d”);

$dateDiff = dateDiffInDays($entrydate, $currentdate);

if($dateDiff >= 90){
echo "It been over 90 days, it’s been " . $dateDiff . " days
";
} else{
echo “It’s still not 90 days, it’s only been " . $dateDiff . " days
”;
}

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.